Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help me please understand this Visual Basic command | Excel Discussion (Misc queries) | |||
Is there a command in visual basic to move down one space, e.g. m. | Excel Programming | |||
What is the Visual Basic command to select an entire row in Excel. | Excel Programming | |||
What is the Visual Basic command to select an entire row in Excel. | Excel Programming | |||
visual basic command in a cell?? | Excel Programming |