How to sendkeys multiple keys vba

OMGSALESFORCE2

New Member
Joined
Feb 24, 2021
Messages
24
Office Version
  1. 365
  2. 2019
  3. 2016
1615343191465.png
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
what are you actually trying to work around here and the other post?
 
Upvote 0
1615344537294.png

idk i tab with the blue circle above to make the browser the actively selected application.
Then i try to send keys \5

i want to do a mousekey with vba

basically in regedit or RegistryEditor for the PC, under HKEY_Current_USER ther are Cursors, Keyboard, and Mouse.

I use the code in the below video to normally click around and record a series of left clicks in a row; however, this method doesn't work on one PC, so I'm trying to find a workaround and simulate a left click with a mouse with VBA without using the user32.dll and Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up Private Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down Private Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up Private Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down Private Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move


Youtube video:
 
Upvote 0
I've also tried using Shell to bring up the browser, set the cursor position, send the macro to another sub to wait 10 seconds, then send it back to the first sub with the active browser application and use vbkeyLButton to left click and that doesn't work:

1615346002790.png






Key Codes:
Constant Value Description
vbKeyLButton 1 Left mouse button
vbKeyRButton 2 Right mouse button
vbKeyCancel 3 CANCEL key
vbKeyMButton 4 Middle mouse button
vbKeyBack 8 BACKSPACE key
vbKeyTab 9 TAB key
vbKeyClear 12 CLEAR key
vbKeyReturn 13 ENTER key
vbKeyShift 16 SHIFT key
vbKeyControl 17 CTRL key
vbKeyMenu 18 MENU key
vbKeyPause 19 PAUSE key
vbKeyCapital 20 CAPS LOCK key
vbKeyEscape 27 ESC key
vbKeySpace 32 SPACEBAR key
vbKeyPageUp 33 PAGE UP key
vbKeyPageDown 34 PAGE DOWN key

vbKeyEnd 35 END key
vbKeyHome 36 HOME key
vbKeyLeft 37 LEFT ARROW key
vbKeyUp 38 UP ARROW key
vbKeyRight 39 RIGHT ARROW key
vbKeyDown 40 DOWN ARROW key
vbKeySelect 41 SELECT key
vbKeyPrint 42 PRINT SCREEN key
vbKeyExecute 43 EXECUTE key
vbKeySnapshot 44 SNAPSHOT key
vbKeyInsert 45 INS key
vbKeyDelete 46 DEL key
vbKeyHelp 47 HELP key
vbKeyNumlock 144 NUM LOCK key


KeyA Through KeyZ Are the Same as Their ASCII Equivalents: 'A' Through 'Z'
Constant Value Description
vbKeyA 65 A key
vbKeyB 66 B key
vbKeyC 67 C key
vbKeyD 68 D key
vbKeyE 69 E key
vbKeyF 70 F key
vbKeyG 71 G key
vbKeyH 72 H key
vbKeyI 73 I key
vbKeyJ 74 J key
vbKeyK 75 K key
vbKeyL 76 L key
vbKeyM 77 M key
vbKeyN 78 N key
vbKeyO 79 O key
vbKeyP 80 P key
vbKeyQ 81 Q key
vbKeyR 82 R key
vbKeyS 83 S key
vbKeyT 84 T key
vbKeyU 85 U key
vbKeyV 86 V key
vbKeyW 87 W key
vbKeyX 88 X key
vbKeyY 89 Y key
vbKeyZ 90 Z key


Key0 Through Key9 Are the Same as Their ASCII Equivalents: '0' Through '9
Constant Value Description
vbKey0 48 0 key
vbKey1 49 1 key
vbKey2 50 2 key
vbKey3 51 3 key
vbKey4 52 4 key
vbKey5 53 5 key
vbKey6 54 6 key
vbKey7 55 7 key
vbKey8 56 8 key
vbKey9 57 9 key


Keys on the Numeric Keypad
Constant Value Description
vbKeyNumpad0 96 0 key
vbKeyNumpad1 97 1 key
vbKeyNumpad2 98 2 key
vbKeyNumpad3 99 3 key
vbKeyNumpad4 100 4 key
vbKeyNumpad5 101 5 key
vbKeyNumpad6 102 6 key
vbKeyNumpad7 103 7 key
vbKeyNumpad8 104 8 key
vbKeyNumpad9 105 9 key
vbKeyMultiply 106 MULTIPLICATION SIGN (*) key
vbKeyAdd 107 PLUS SIGN (+) key
vbKeySeparator 108 ENTER (keypad) key
vbKeySubtract 109 MINUS SIGN (-) key
vbKeyDecimal 110 DECIMAL POINT(.) key
vbKeyDivide 111 DIVISION SIGN (/) key


Function Keys
Constant Value Description
vbKeyF1 112 F1 key
vbKeyF2 113 F2 key
vbKeyF3 114 F3 key
vbKeyF4 115 F4 key
vbKeyF5 116 F5 key
vbKeyF6 117 F6 key
vbKeyF7 118 F7 key
vbKeyF8 119 F8 key
vbKeyF9 120 F9 key
vbKeyF10 121 F10 key
vbKeyF11 122 F11 key
vbKeyF12 123 F12 key
vbKeyF13 124 F13 key
vbKeyF14 125 F14 key
vbKeyF15 126 F15 key
vbKeyF16 127 F16 key
 
Upvote 0
so you are trying to do an internet automation? what is the site, and what do you need to do. there are VBA tools specifically designed for ripping info off the web / interacting with webpages
 
Upvote 0

Forum statistics

Threads
1,226,138
Messages
6,189,217
Members
453,529
Latest member
_Angelica_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top