View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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