LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Visual basic for a rightkey command

add a delay between mouse down and mouse up in the code below

'Send the mouse event
If bRightClick Then
lFlags = MOUSEEVENTF_RIGHTDOWN Or MOUSEEVENTF_ABSOLUTE
Else
lFlags = MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_ABSOLUTE
End If

mouse_event lFlags, lX, lY, 0, 0
DoEvents

'Delay
'------------------------------------------------------
If Application.Wait(Now + TimeValue("0:00:01")) Then
MsgBox "Time expired"
End If
'------------------------------------------------------

If bRightClick Then
lFlags = MOUSEEVENTF_RIGHTUP Or MOUSEEVENTF_ABSOLUTE
Else
lFlags = MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE
End If



"Zakynthos" wrote:

Joel,

Perfect! thanks for thatnow have coordinates and script runs but one last
problem - the right click seems to be working becasue the icon is flickering
when I send the script but it's only a flicker! I've then used sendkeys to
send a 'down' and an 'enter' to select and enter the first item in the pop up
window but they don't work because, I think the right click is too brief to
activate the pop-up box(???)

If this is likely to be the problem, then can I send a 'wait' command or
include a script to 'hold' the right mouse click?

Many thanks,

Zak

"Zakynthos" wrote:

I need to right click an icon in an explorer window of a database, which only
seems to work with a right mouse click. I've tried the right click key on
the keyboard and it doesn't work.

I've also tried other key combinations to see if I could simulate the right
mouse click with a sendkeys statement such as ctrl and f10 but that doesn't
work either.

Is there a way of creating this rightclick in Visualbasic code?

Many thanks.

 
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
Help me please understand this Visual Basic command Steve Excel Discussion (Misc queries) 1 September 16th 08 06:14 PM
Is there a command in visual basic to move down one space, e.g. m. Brent Excel Programming 1 September 28th 05 02:04 AM
What is the Visual Basic command to select an entire row in Excel. Jorge Rodrigues Excel Programming 1 September 22nd 04 02:04 PM
What is the Visual Basic command to select an entire row in Excel. Ron de Bruin Excel Programming 0 September 22nd 04 01:55 PM
visual basic command in a cell?? konky Excel Programming 1 August 26th 03 06:33 PM


All times are GMT +1. The time now is 03:36 PM.

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

About Us

"It's about Microsoft Excel"