ClimoC
Well-known Member
- Joined
- Aug 21, 2009
- Messages
- 584
So I get and can store public variant/double to use to start/stop an OnTime routine.
How do you stop 'Application.OnTime' if you were to lose that variable due to a code execution error?
Am trying to refresh a connection to an accdb file every 5 seconds, if it crashes, won't it just continue ad infinitum?
I've tried writing the double-value (and also tried a date/time value) to a cell in an empty sheet to store, and pointing to that - but the thing wouldn't stop!
Ideally, when the rest of the workbook is finished, it will all be bulletproof of course and never bug (therefore, never lose the value held) but for debugging and while building/testing, and for my own piece of mind, does anyone else ever have this problem?
The other thing is that thanks to some annoying code in XL2010, I've noticed that even if you enable all macros, trust acces to the VB module etc etc, that if someone opens another workbook, and they don't 'enable' it when prompted by the golden info ribbon, that the whole application locks up vba access - not just the newly opened workbook. This plays real havoc with my activate/deactivate/before_close bits.
How do you stop 'Application.OnTime' if you were to lose that variable due to a code execution error?
Am trying to refresh a connection to an accdb file every 5 seconds, if it crashes, won't it just continue ad infinitum?
I've tried writing the double-value (and also tried a date/time value) to a cell in an empty sheet to store, and pointing to that - but the thing wouldn't stop!
Ideally, when the rest of the workbook is finished, it will all be bulletproof of course and never bug (therefore, never lose the value held) but for debugging and while building/testing, and for my own piece of mind, does anyone else ever have this problem?
The other thing is that thanks to some annoying code in XL2010, I've noticed that even if you enable all macros, trust acces to the VB module etc etc, that if someone opens another workbook, and they don't 'enable' it when prompted by the golden info ribbon, that the whole application locks up vba access - not just the newly opened workbook. This plays real havoc with my activate/deactivate/before_close bits.