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 position my mouse cursor on my desired spot on screen

the mouse position really has no effect on where SendKeys are sent. They
are sent to the activewindow. You would need to use the Windows API to
bring your window to the foreground and then do the sendkeys.

this code might give you some ideas:

http://vbnet.mvps.org/index.html?cod...estorehwnd.htm

--
Regards,
Tom Ogilvy


"Edmund" wrote in message
...
How can I tell VBA to position my mouse cursor at my desired point on
screen?

Certain applications (non MS Office) in my desktop does not support
navigation using keyboard punches (eg Ctrl+Right Arrow to select its next
tab). Therefore, I need to tell "VBA to go to a certain position on the
screen". When this is achieved, I will use sendkey (SendKeys "~", True)
wrap
up the task.

Pls show me some sample codes. I will adjust the X & Y value to my desired
position.

Edmund
Using Excel 2000