Trick screen saver

petereddy

New Member
Joined
Feb 6, 2014
Messages
39
Hi,

The common method I use for avoiding the group policy screen saver on my machine when I'm actively using my computer, but not necessarily typing, such as working from hard copies and with information on the screen, is to have Excel hit F15 every now and then:
VBA Code:
Sub startTheClock()
    Application.OnTime Now + 4 / 60 / 24, "hitf15"
End Sub
Sub hitF15()
    SendKeys "{F15}"
    startTheClock
End Sub
This definitely prevents the screen saver from starting, but it has the obvious unintended consequence of toggling NumLock.

Is there a method that has no unintended consequences?

I think I read somewhere when I first investigated how to prevent the screen saver from popping up at inopportune times that you could move the mouse an imperceptible amount. Is that an option with VBA? If so, how can you do it? If not, are there other alternatives.

Thanks for your help.

Peter
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
11,981
Office Version
  1. 365
Platform
  1. Windows
Multiple F15 sends in the same procedure don't appear to toggle back but this looks like it works, although I have only done a very quick test.
VBA Code:
Sub startTheClock()
    Application.OnTime Now + 4 / 60 / 24, "hitf15"
End Sub
Sub hitF15()
    SendKeys "{F15}"
    Application.Wait Now + TimeValue("00:00:01")
    hitF15again
End Sub
Sub hitF15again()
    SendKeys "{F15}"
    startTheClock
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,123,337
Messages
5,601,026
Members
414,422
Latest member
acegreen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top