Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA to control the Mouse


Is there anyway to control the mouse movements, position, and clicks? I
need to control the mouse to click a certain area on my database screen.
I can't get the control with the keyboard, and the mouse is the only
other option.

TIA,

DejaVu


--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=476871

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA to control the Mouse

Unless you are programming some type of instructional routine that guides
the user to perform an action, you are headed in the wrong direction. If
you need to execute the click event for a commandbutton in Sheet1 (Sheet1
being the code name) for example, you would rename the click event to public

Private Sub CommandButton1_Click()

becomes

Public Sub CommandButton1_Click()

then you could do

Sheet1!CommandButton1_Click()

to execute the click event.

easier is move the meat of the code to a general module a a public sub and
then you can call that from either the click event or your own routine

Private Sub CommandButton1_Click()
MyCode
End Sub

in a general module

Public Sub Mycode()
' code that used to be in the click event
End Sub



--
Regards,
Tom Ogilvy


"DejaVu" wrote in
message ...

Is there anyway to control the mouse movements, position, and clicks? I
need to control the mouse to click a certain area on my database screen.
I can't get the control with the keyboard, and the mouse is the only
other option.

TIA,

DejaVu


--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile:

http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=476871



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA to control the Mouse


Thanks for the reply Tom.

I'm still not sure how to handle this though... I don't want to click
anywhere on a worksheet (or even in excel for that matter). I need to
mouse click on another program. Can I use VB code to control what the
mouse does, or can I use some sort of API call to (1) Open the program
window and (2) make the mouse click on a specified pixel or "latitude"
& "longitude" on my screen? I thought I read something that it was
possible to input the coordinates and have the mouse move there and
click on command... am I way off??

Thanks,

DejaVu


--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=476871

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA to control the Mouse

I have no idea if you can do that - but if you can, I would say the approach
definitely isn't a route heavily travelled.

--
Regards,
Tom Ogilvy

"DejaVu" wrote in
message ...

Thanks for the reply Tom.

I'm still not sure how to handle this though... I don't want to click
anywhere on a worksheet (or even in excel for that matter). I need to
mouse click on another program. Can I use VB code to control what the
mouse does, or can I use some sort of API call to (1) Open the program
window and (2) make the mouse click on a specified pixel or "latitude"
& "longitude" on my screen? I thought I read something that it was
possible to input the coordinates and have the mouse move there and
click on command... am I way off??

Thanks,

DejaVu


--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile:

http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=476871



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA to control the Mouse


Thanks for your help Tom. I'll figure something out ... eventually!

DejaV

--
DejaV
-----------------------------------------------------------------------
DejaVu's Profile: http://www.excelforum.com/member.php...fo&userid=2262
View this thread: http://www.excelforum.com/showthread.php?threadid=47687

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse control Tony S Excel Worksheet Functions 4 December 12th 06 08:45 PM
Mouse Control sparx[_2_] Excel Programming 4 September 14th 05 09:46 PM
control-tab should move between Excel sheets without a mouse. SpecialK Excel Worksheet Functions 2 July 7th 05 08:45 PM
my mouse moves diagonally when i scroll on mouse? BKMISHRA Excel Worksheet Functions 0 June 29th 05 11:43 AM
moving mouse highlights cells without touching left mouse button bremboy Excel Discussion (Misc queries) 2 January 27th 05 06:19 PM


All times are GMT +1. The time now is 07:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"