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

Last reviewed: September 2, 1997
Article ID: Q89285
The information in this article applies to:
  • Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a, 5.0, 5.0c
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a

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 : EvnOthr kbenv kbprg xlwin kbdisplay kbprg
Version : 3.00 4.00 4.00a 5.00 5.00c 7.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.