This post contains Scenario A code - Each 'pseudo' timer has it's own code. See the attached file which uses 5 timers.
Please note the following:
a. A global variable is REQUIRED to save the Scheduled Timer 'Start Time'. stoptimer() is REQUIRED in the ThisWorkbook module when the Workbook closes to prevent the file from being automatically reopened when the
file is closed, and another workbook is open at the same time in the same instance of Excel. stoptimer() needs the global time value to work properly when the file closes.
b. There is a small amount of overhead when doing real time processing. The algorithm being used to increment the time by one second with each timer event will cause a 72 hour event to time out at some time after 72 hours. I have not benchmarked the amount of overhead, but 0.01% overhead will cause 72 hours to be 26 seconds late. Larger amounts of overhead will cause an even bigger delay. The solution (for sometime in the future) is to use the actual 'Target' completion date and time.
In the ThisWorkbook code module:
In ordinary code module Module1:
In the UserForm1 Code module - changes in red. NOTE: Calls to D56Timer() and D57Timer() were deleted. Code for the 3 new timers was NOT added to the Userform code.
Lewis
Bookmarks