All - thanks for your responses,
I've pieced together what I was looking for. The below code will click on a spot on the screen that you designate with coordinates every x seconds. It works beautifully.
All I need now is to figure out the right syntax to stop the code.
Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Dim TimerActive As Boolean
Sub KeepWindowsActive()
TimerActive = True
'move cursor and click
SetCursorPos 200, 200 'x and y position
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
Application.OnTime Now + TimeValue("00:00:10"), "KeepWindowsActive"
End Sub
Anyone know the correct way to stop it?
thanks,
Keith