Purpose
This method schedules a procedure to be run at a specified time in the future (either at a specific time of day or after a specific amount of time has passed).
Syntax
OnTime(EarliestTime, Procedure, LatestTime, Schedule)
Required Parameters
EarliestTime
The time when you want this procedure to be run.
Procedure
The name of the procedure to be run.
Optional Parameters
LatestTime
The latest time at which the procedure can be run. For example, if LatestTime is set to EarliestTime + 30 and Microsoft Excel is not in Ready, Copy, Cut, or Find mode at EarliestTime because another procedure is running, Microsoft Excel will wait 30 seconds for the first procedure to complete. If Microsoft Excel is not in Ready mode within 30 seconds, the procedure won’t be run. If this argument is omitted, Microsoft Excel will wait until the procedure can be run.
Schedule
True to schedule a new OnTime procedure. False to clear a previously set procedure. The default value is True.