Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi, i need a macro to move mouse pointer and simulate mouse click to access
activate a report. sendkey dont work as to run the report will require a mouse buttom click. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi William
To control the mouse using code try the below. You will need to adjust the cursor positions to suit your requirement. (in the below example it is 150,200) . Try and feedback. --Insert a module and copy the below declarations. '--------------------------------------------------------------------------------- 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 Declare Function GetMessageExtraInfo Lib "user32" () As Long '--------------------------------------------------------------------------------- --Copy the below code to the macro Private Sub Macro() 'your other code SetCursorPos 150, 200 mouse_event &H2, 0, 0, 0, GetMessageExtraInfo() mouse_event &H4, 0, 0, 0, GetMessageExtraInfo() End Sub If this post helps click Yes --------------- Jacob Skaria "William Yeow" wrote: hi, i need a macro to move mouse pointer and simulate mouse click to access activate a report. sendkey dont work as to run the report will require a mouse buttom click. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the mean while I assume you already know about AppActivate Function which
activates an application that is already running. http://msdn.microsoft.com/en-us/libr...hy(VS.80).aspx If this post helps click Yes --------------- Jacob Skaria "Jacob Skaria" wrote: Hi William To control the mouse using code try the below. You will need to adjust the cursor positions to suit your requirement. (in the below example it is 150,200) . Try and feedback. --Insert a module and copy the below declarations. '--------------------------------------------------------------------------------- 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 Declare Function GetMessageExtraInfo Lib "user32" () As Long '--------------------------------------------------------------------------------- --Copy the below code to the macro Private Sub Macro() 'your other code SetCursorPos 150, 200 mouse_event &H2, 0, 0, 0, GetMessageExtraInfo() mouse_event &H4, 0, 0, 0, GetMessageExtraInfo() End Sub If this post helps click Yes --------------- Jacob Skaria "William Yeow" wrote: hi, i need a macro to move mouse pointer and simulate mouse click to access activate a report. sendkey dont work as to run the report will require a mouse buttom click. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007: mouse cant find cell handle to drag/move | Excel Discussion (Misc queries) | |||
Mouse Move | Excel Programming | |||
Highlight 1 cell in Excel & move mouse-stays highlighted - stop? | Excel Discussion (Misc queries) | |||
control-tab should move between Excel sheets without a mouse. | Excel Worksheet Functions | |||
move mouse or cursorpos | Excel Programming |