mtheriault2000
Well-known Member
- Joined
- Oct 23, 2008
- Messages
- 826
Hello
I'm using GetAsyncKeyState to verify if the shift key as been press while a macro is activated. It work perfectly when i use the f8, step by step, debug process, give error 400 when running
The sub TestShiftKey is called by another macro
Any help appreciated
I'm using GetAsyncKeyState to verify if the shift key as been press while a macro is activated. It work perfectly when i use the f8, step by step, debug process, give error 400 when running
The sub TestShiftKey is called by another macro
Code:
Private Declare Function GetAsyncKeyState Lib _
"user32" (ByVal vKey As Long) As Integer
Public Sub TestShiftKey()
' (&H10) = Shift Key Code
If GetAsyncKeyState(&H10) Then
ShiftKeyPress = True
'MsgBox "Shift key is pressed"
Else
ShiftKeyPress = False
End If
End Sub
Any help appreciated