Determine of control mouse
If you need to locate position mouse on screen. You can use vba code below:
Dim MyPointAPI As POINTAPI
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GETCURSORPOS Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Public Sub MouseCursorGetOurXY()
'this was taken online quite a while ago, left everything as copied from the original source
Dim L As Long
Application.Wait (Now() + TimeValue("00:00:02"))
L = GETCURSORPOS(MyPointAPI) 'get our cursor position first
MsgBox CStr(MyPointAPI.X) & ", " & CStr(MyPointAPI.Y) 'displays cursor X Y coordinates
End Sub