I am designing a dashboard-like workbook in Excel and I’ve created a routine to show some Charts from time to time automatically using the Application.OnTime method from Excel VBA, but I am having some problems debugging my routines.
There are three scheduled routines:
the first takes a snapshot of the data for the charts, the second starts the exhibition of the charts and the third, started by the second, cicles through the charts, showing them for a brief period of time
My main problem is to keep track of the last execution of the routines, because each one of them schedule themselves with Application.OnTime
So I have two questions:
One: Is there a way to see the scheduled routines from Application.OnTime in Excel?
Two: Is there a better way to schedule repetitive routines using VBA?
There’s no way that I know to get what is scheduled. When I was debugging a program that used OnTime, I made my own log so I could see what got scheduled and when.
This uses an error handling system, so you’ll have to fix it up for yours or remove the error handling stuff.
If you have multiple OnTimes going, you’ll need an array or collection to keep track. Mine was just one macro either scheduled to run or not, so my global variable/constant did the trick.