Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created a macro that runs a simulation with random variables which runs over one year, in hours, less downtime hours. This equals 8214 hours. I now need to create an animation in either VB (using VS 2010) or VBA that runs with a timer running for the 8214 timesteps. I think each timestep should not take more than 0.10 seconds.

The output of the simulation is a spreadsheet which has a number of columns, but the ones relevant for the animation are:
1. Hours (these are the hours of the simulation = 8214. Each cell represents an hour.
2. Delay times - there are 12 delays calculated per annum and each one is 34 hours long. They are set to randomly appear throughout the 8214 hours. When a delay "arrives" nothing can happen anywhere for 34 hours (timesteps)
3. Ship Arrival times - this shows either 1 or 0. If it's a 1 it means a ship has arrived, if it shows 0 it means nothing.
4. Loading Berth 01 and Loading Berth 02. If either of these columns shows 1 it means that a ship is sailing either to or from the relevant berth. If either of the columns shows 2 it means the ship is being loaded at the relevant berth.
5. Train Arrival Times. If this is greater than 0 then it means a train is in the station and being offloaded
5. Total export volume- at the bottom of the animation page I want to show a moving graph over the time steps which shows the export volume growing as the timesteps move from 1 to 8214
6. Total Stockpile - This shows the stockpile growing and reducing as it is being added to by the train or removed by the ship.

Ultimately what I'd like to do is show a simple animation for the full 8214 hours showing simultaneously the following:
ships arriving
ships sailling
ships loading
train in station off loading
stockpile growing or shrinking
export volume graph increasing

THis does not need to be a complicated 3D graphics animation, just a 2D with jpgs popping up at the relevant timesteps and staying up for as long as they need to and then disappearing

I appreciate any help on this.
Posted
Comments
Maciej Los 9-Apr-13 9:40am    
And what have you done till now? Where are you stuck?
Member 9357265 9-Apr-13 10:10am    
It's not really a matter of being stuck as I don't really know where to start when it comes to displaying images according to cell values.I can send you the excel spreadsheet output from my simulation model which may help you understand what I am asking for.
CHill60 9-Apr-13 11:55am    
does this help http://www.mcgimpsey.com/excel/lookuppics.html
or this
http://www.ozgrid.com/forum/showthread.php?t=56067
Maciej Los 10-Apr-13 15:14pm    
This not work like that!!!
See my answer.

As i wrote in comment: This not work like that!!! If you shortly describe your problem, CP members can help you to find solution, but they don't do that for you.

I suggest you to follow these links:
VS 2010: Timer Class[^]
Excel: Wait() method[^]

Finally, try to do something!
 
Share this answer
 
I'm an absolute novice and I have spent 2 weeks trying to get this to work, so please don't tell me "try to do something"!

I was hoping that if I gave more information than less someone would point me in the right direction (other than sending me to the MSDN library), I was not intending you to write the entire project. CHili60's suggestion was helpful and was the kind of thing I was after.

Thanks anyway
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900