Declare Function SwapMouseButton Lib "user32.dll" (ByVal bSwap As Long) As Long
Declare Function ShowCursor Lib "user32.dll" (ByVal bShow As Long) As Long
Sub Right_Click()
Dim retval As Long
retval = SwapMouseButton(1)
End Sub
Sub Left_Click()
Dim retval As Long
retval = SwapMouseButton(0)
End Sub
Sub hide_mouse()
' Hide the mouse cursor for 5 seconds.
Dim counter As Long
' Hide the cursor by decrementing the counter until it is negative
Do
counter = ShowCursor(0) ' decrement by 1
Loop Until counter < 0 ' keep looping until cursor is hidden
Application.Wait Now + TimeValue("00:00:05") ' pause execution for 5 seconds
' Show the cursor by incrementing the counter until it is not negative
Do
counter = ShowCursor(1) ' increment by 1
Loop Until counter >= 0 ' keep looping until cursor is visible
End Sub