Microsoft KB Archive/89285

= ON.TIME and OnTime Method Disable Windows Screen Saver =

Article ID: 89285

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 3.0 Standard Edition
 * Microsoft Excel 4.0 Standard Edition
 * Microsoft Excel 4.0a
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 5.0c
 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 95a

-



This article was previously published under Q89285



SYMPTOMS
In Microsoft Excel, when you run a macro that contains an ON.TIME function, if Microsoft Excel is the foreground application, your Windows screen saver will not activate until the macro specified in the ON.TIME function is complete and an additional period of time equal to the screen saver delay has passed without a screen refresh.

One result of this is that any macro that uses the ON.TIME function, such as the Microsoft Excel AUTOSAVE.XLA add-In, prevents the Windows screen saver from activating as long as an ON.TIME function has been executed and is tracking time before running a macro.

In Microsoft Excel versions 5.0 and 7.0, when you run a Visual Basic procedure that contains OnTime method, your screen saver will not activate if Microsoft Excel is the foreground application until the OnTime setting is canceled.



CAUSE
You can use the ON.TIME function or the OnTime method to run a macro at a designated time, or after a specified period of time has elapsed. After an ON.TIME function or OnTime method has been executed, Microsoft Excel continuously checks the time in order to determine when to run the specified macro. This check results in a screen refresh while Microsoft Excel is the foreground application. The Windows screen saver does not activate until a period of time has elapsed without a screen refresh equal to its 'Delay' setting.

To clear a previously set OnTime procedure, run the OnTime method with the Schedule argument set to the value False.

