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



The information in this article applies to:

  • Microsoft Excel for Windows 3.0
  • Microsoft Excel for Windows 4.0
  • Microsoft Excel for Windows 4.0a
  • Microsoft Excel for Windows 5.0
  • Microsoft Excel for Windows 5.0c
  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 95 7.0a

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.

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


Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbenv kbProgramming KB89285