ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send mouse click? (https://www.excelbanter.com/excel-programming/317039-send-mouse-click.html)

Johan Johansson

Send mouse click?
 
I'm looking for a command like "Sendkey" but "send mouse click" (left
button)

I would appreciate if someone posted a code example, just a simple
click of the left mouse button and my day would be saved ;)

/Johan

ManualMan

Send mouse click?
 
Hi,

Don't know any other way then by API

First declare this:
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As
Integer

Then adapt and insert this somewhere

If GetAsyncKeyState(1) < 0 Then MsgBox "leftbutton"
If GetAsyncKeyState(2) < 0 Then MsgBox "rightbutton"
Regards,
ManualMan
http://www.gamesXL.tk



All times are GMT +1. The time now is 09:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com