What code does: I have a code that moves the mouse around the screen, takes printscreens and pastes it to excel.
Problem: For some
I found this solution so far the best and does not interfere with NUMLOCK. Put below code in a module and call it from anywhere in your project. The script object overwrites the SendKeys in VBA.
Public Sub Sendkeys(text as variant, Optional wait As Boolean = False)
Dim WshShell As Object
Set WshShell = CreateObject("wscript.shell")
WshShell.Sendkeys cstr(text), wait
Set WshShell = Nothing
End Sub
I found it in below thread:
SendKeys() permission denied error in Visual Basic