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

ID: Q89285

The information in this article applies to:

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.

REFERENCES

"Microsoft Excel Function Reference," version 4.0, pages 305-306

For More information about the OnTime Method, choose the Search button in the Visual Basic Reference and type:

    OnTime Method

Additional query words: screensaver 3.00 4.00 5.00 7.00
Keywords          : kbenv kbprg xlwin 
Version           : 3.00 4.00 4.00a 5.00 5.00c 7.00
Platform          : WINDOWS

Last Reviewed: September 3, 1997