Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Object programming in Excel

I am trying to setup a simulation for a process flow of carts on a
factory floor and I want to make a simulation in Excel. What we do is
have cards that represent carts and we move the carts from machine to
machine according to the rules at each machine. This is all done with
paper cards on a desk. What I am thinking is putting obejects on the
screen of Excel, like command buttons or flow chart shapes, and then
visually move them from 1 location (cell) to another as my VB code
runs thru each increment of time and what is supposed to happen with
each cart. This is where I am struggling. I would like to have the
cart "object", what ever that is, have some additional properties.
Something like this:
Cart_1.movetime
Cart_1.timeatmachine
Cart_1.partcount
etc.
How and what would be the best "object" to use to be able to add
properties to like above and then change them as the VB program walks
thru a time range and moves the carts according to their individual
parameters.
I am not looking for someone elses program to do this, as I have seen
them, I want to set it up to run the way I want it to work.
I am pretty good with VBA so do hold back on a solution that would be
great but complicated to create.

I appreciate any help or direction you can give me.
Thanks
Scott
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Object programming in Excel

Type Cart

movetime As Integer
timeatmachine As Date
partcount As Long

End Type

Sub main()

Dim Cart_1 As Cart

Cart_1.movetime = 10
Cart_1.timeatmachine = DateValue("1:00")
Cart_1.partcount = 100

End Sub


"Scott" wrote:

I am trying to setup a simulation for a process flow of carts on a
factory floor and I want to make a simulation in Excel. What we do is
have cards that represent carts and we move the carts from machine to
machine according to the rules at each machine. This is all done with
paper cards on a desk. What I am thinking is putting obejects on the
screen of Excel, like command buttons or flow chart shapes, and then
visually move them from 1 location (cell) to another as my VB code
runs thru each increment of time and what is supposed to happen with
each cart. This is where I am struggling. I would like to have the
cart "object", what ever that is, have some additional properties.
Something like this:
Cart_1.movetime
Cart_1.timeatmachine
Cart_1.partcount
etc.
How and what would be the best "object" to use to be able to add
properties to like above and then change them as the VB program walks
thru a time range and moves the carts according to their individual
parameters.
I am not looking for someone elses program to do this, as I have seen
them, I want to set it up to run the way I want it to work.
I am pretty good with VBA so do hold back on a solution that would be
great but complicated to create.

I appreciate any help or direction you can give me.
Thanks
Scott

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Object programming in Excel

I like the code you posted. I can definately use that and expand on
it.
What do you think would be the best object to use for a visual look? I
have been thinking of using a command button (activeX control) as I
can change a lot of its properties like color, text to better show
what each is and what is happening to each cart as it moves through my
system.

Thanks for the code! Most appreciated.
Scott Riddle
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Object programming in Excel

Have you ever built a VBA user form. On VBA menu : Insert - Userform

"Scott" wrote:

I like the code you posted. I can definately use that and expand on
it.
What do you think would be the best object to use for a visual look? I
have been thinking of using a command button (activeX control) as I
can change a lot of its properties like color, text to better show
what each is and what is happening to each cart as it moves through my
system.

Thanks for the code! Most appreciated.
Scott Riddle

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Object programming in Excel

I have made several userforms. Why?
I was playing around with a command button to represent a cart and one
thing I noticed is that you can not select them and move them around
easily (with out being in design mode). I think I would like to have
the user be able to move the carts around manually if needed. I am
thinking of creating named ranges for each machine and then move the
carts into the named range area. I would have a sub to sort and stack
them at each machine and each would have a seperate que number to
control the order in which they move on to the next machine.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Object programming in Excel

A userform has two modes modal and modeless. I think you want modeless. The
uwserform I'm referering to is not on the worksheet. Go to VBA and add a
userform. Put a couple of controls on the user form. The go to a VBA module
and run the userform. The first userform will automatically be called
userform1.

Sub Main

userform1.show

end main

[object.]Show modal



Settings

The settings for modal a

Constant Value Description
vbModal 1 UserForm is modal. Default.
vbModeless 0 UserForm is modeless



"Scott" wrote:

I have made several userforms. Why?
I was playing around with a command button to represent a cart and one
thing I noticed is that you can not select them and move them around
easily (with out being in design mode). I think I would like to have
the user be able to move the carts around manually if needed. I am
thinking of creating named ranges for each machine and then move the
carts into the named range area. I would have a sub to sort and stack
them at each machine and each would have a seperate que number to
control the order in which they move on to the next machine.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object oriented programming in vba M1kehailu Excel Programming 9 February 17th 09 06:56 PM
Programming a chart object Phil Stanton[_2_] Excel Programming 3 June 9th 08 01:14 PM
Need help with Range object in Macro programming Dan[_49_] Excel Programming 4 October 19th 06 07:26 PM
Programming code to new object Martin Excel Programming 12 August 9th 05 10:45 AM
Confusion about how the Window object fits into the Excel object model Josh Sale Excel Programming 11 April 15th 05 06:08 PM


All times are GMT +1. The time now is 08:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"