Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
Mouse Clik in VBA

since I am doing VBA program to download some files in one target website with
automatical mouse simulation. But if when I donwload 500 files, it will take long long
time and occupy my computer usage by my VBA program. In other words, I would like
to use mouse at the same time with VBA mouse-click simuatlion program running for
files downloading.
Is there any function in VBA to replace the leftdown/rightdown click so that
free mouse to use other operation like open new wbe webpage site ?
Please advise
Duncan
Private Declare Sub mouse_event Lib "USER32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)Const MOUSEEVENTF_RIGHTDOWN = &H8Const MOUSEEVENTF_RIGHTUP = &H10Const MOUSEEVENTF_leftDOWN = &H2Const MOUSEEVENTF_leftUP = &H4Declare Function LockWindowUpdate Lib "USER32" (ByVal hWnd As Long) As LongPrivate Declare Function GetDesktopWindow Lib "USER32" () As LongPrivate Type POINTAPI x As Long y As LongEnd TypePrivate Declare Function GetCursorPos Lib "USER32" _(lpPoint As POINTAPI) As Long'**Win32 API User Defined TypesPrivate Type RECTLeft As LongTop As LongRight As LongBottom As LongEnd TypeSub mouseclick()SetCursorPos aaleft + 400, aatop + 520 'Trans Record download barCall leftDownEnd SubPublic Sub leftDown()mouse_event MOUSEEVENTF_leftDOWN, 0, 0, 0, 0mouse_event MOUSEEVENTF_leftUP, 0, 0, 0, 0End Sub
1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.
Finally it works really well. THe program is running standalone automatically, and my mouse can be free
to do other job without ocuppy my the program running.