.
Try this :
Option Explicit
Private dtmNext As Date
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (Point As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Integer, ByVal y As Integer) As Long
Sub Move_Cursor()
Dim Hold As POINTAPI
GetCursorPos Hold
SetCursorPos Hold.x + 1, Hold.y '<--- The integer 1 indicates a cursor location change every one minute. It will be almost unnoticeable but the cursor does move.
dtmNext = DateAdd("n", 1, Now) '<--- The integer 1 indicates a cursor location change every one minute. It will be almost unnoticeable but the cursor does move.
Application.OnTime dtmNext, "Move_Cursor"
End Sub
Sub Stop_Cursor()
Application.OnTime dtmNext, "Move_Cursor", , False
End Sub
Bookmarks