I have a series of graphs (over 1000) that each one one a point in time. I want to basically make them each one frame (like a movie frame) and play them in series so I can see how it chnages over time. I have gotten pretty far into it by flipping the visibility of the charts on and off, however it stops animating if there are too many frames or charts that it is going through. I kind of fixed it by skipping many of the charts, which for the data I have now works ok. However I want to be able to use this for set of data that might have many more charts (maybe 20,000).
There are two things I am having issues with, I want to have finer control over the amount of time they are visible and I want to program to be more robust.
When the animation stops it seems like the code is still going but just not updating the spreadsheet because after a bit it will update my counter to the end and no errors will show and I will act like it just competed the code. Also it runs better with a large time increment (1 sec). But that makes it very choppy and long
Here is the code I am using currently. Any ideas are much appreciated, even if its an alternate way of animating the charts.
Please Login or Register to view this content.
Dim i As Integer
Dim j As Integer
Dim t As Integer
Dim c As Integer
c = 0
Cells(1, 2) = ActiveSheet.ChartObjects.Count
j = ActiveSheet.ChartObjects.Count
t = j / 100 'this is how i am skipping some charts, its kinda a short term fix
For i = 1 To j Step t
ActiveSheet.ChartObjects(i).Visible = 1
Application.Wait Now + TimeSerial(0, 0, 0.5) 'this is the time, it doesn't actually pause on each for .5 of a sec its much less and I would like more control
ActiveSheet.ChartObjects(i).Visible = 0
c = c + 1
Cells(2, 1) = c 'just a counter to I can see where it is at when it stops
Next i
Bookmarks