Screensaver interference

iainf

New Member
Joined
Aug 17, 2007
Messages
3
Hi,

I work for a company that sets screensaver timeout delays centrally. It kicks in after about 5 minutes, and individual users are unable to change the delay. Unfortunately, the macro I have created will run for 2 hours or more. When the screensaver appears the macro stops processing. It doesn't error, and can be resumed when I unlock the system, so it's more of an annoyance than a critical problem.

What I could use is some coding or other resolution that would allow the macro to continue to run while the system is locked, or behind the screensaver.


If anyone has any ideas or has come across this before, it would be great to hear from you.

Many thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
This code is UNTESTED in the environment you describe. :eek:
I would be interested to see if it works.
Code:
'========================================================================
'- CODE TO MOVE MOUSE POINTER ON SCREEN TO STOP SCREEN SAVER WORKING
'- Call MoveMousePointer() from suitable places in the running code
'- Brian Baulsom August 2007
'========================================================================
Private Declare Function SetCursorPos Lib "user32" _
    (ByVal X As Long, ByVal Y As Long) As Long
'------------------------------------------------------

'========================================================
'- THIS IS JUST TO TEST THE CODE
'========================================================
Sub MoveMousePointerTEST()
    For N = 1 To 10
        Beep
        MoveMousePointer    ' ** THIS GOES IN THE APPLICATION CODE **
        '- wait 1 second
        Application.Wait Now + TimeValue("00:00:01")
    Next
    '---------------------------------------------------
    MsgBox ("Done")
End Sub


'========================================================
'- CODE TO MOVE MOUSE POINTER ON SCREEN
'- TO STOP SCREEN SAVER WORKING
'========================================================
Sub MoveMousePointer()
    Static MyX, MyY        ' save values between calls
    '----------------------------------------------------
    '- set position
    If MyX = 0 Or MyX = 1000 Then
        MyX = 100
        MyY = 100
    Else
        MyX = MyX + 10
        MyY = MyY + 10
    End If
    '----------------------------------------------------
    '- move pointer
    SetCursorPos MyX, MyY
    DoEvents
End Sub
'======= end of procedure =================================
 
Upvote 0

Forum statistics

Threads
1,190,912
Messages
5,983,529
Members
439,848
Latest member
timmyo

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