I am using the below link:
http://www.ozgrid.com/Excel/run-macro-on-time.htm
to store the time at which I call a function via ontime
and then cancel it. However, after I store the last time, I call ontime()
then my function closes. The problem is the time I have just stored goes out of scope and chanegs to empty. So using the link above, I am saying that once RunOnTime()
has finished, the value of dTime is empty and therefore when I call CancelOnTime()
it does not work. I declared dTime just as in the example. Everything is the same except I am in ThisWorkbook.
Can anyone advise?
See Question&Answers more detail:os