ON.TIME() and OnTime Method Disable Windows Screen Saver

This article was previously published under Q89285
This article has been archived. It is offered "as is" and will no longer be updated.
In Microsoft Excel, when you run a macro that contains an ON.TIME()function, if Microsoft Excel is the foreground application, your Windowsscreen saver will not activate until the macro specified in the ON.TIME()function is complete and an additional period of time equal to the screensaver delay has passed without a screen refresh.

One result of this is that any macro that uses the ON.TIME() function, suchas the Microsoft Excel AUTOSAVE.XLA add-In, prevents the Windows screensaver from activating as long as an ON.TIME() function has been executedand is tracking time before running a macro.

In Microsoft Excel versions 5.0 and 7.0, when you run a Visual Basicprocedure that contains OnTime method, your screen saver will not activateif Microsoft Excel is the foreground application until the OnTime settingis canceled.
You can use the ON.TIME() function or the OnTime method to run a macro at adesignated time, or after a specified period of time has elapsed. After anON.TIME() function or OnTime method has been executed, Microsoft Excelcontinuously checks the time in order to determine when to run thespecified macro. This check results in a screen refresh while MicrosoftExcel is the foreground application. The Windows screen saver does notactivate until a period of time has elapsed without a screen refresh equalto its 'Delay' setting.

To clear a previously set OnTime procedure, run the OnTime method with theSchedule argument set to the value False.
"Microsoft Excel Function Reference," version 4.0, pages 305-306

For More information about the OnTime Method, choose the Search button inthe Visual Basic Reference and type:
OnTime Method
screensaver 3.00 4.00 5.00 7.00

Article ID: 89285 - Last Review: 10/14/2013 17:50:09 - Revision: 2.3

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

  • kbnosurvey kbarchive kbenv kbprogramming KB89285