Not sure what the code is intended to do ... Sendkeys is fraught with danger.
Trying to test the code in the VBE causes it to write to, and corrupt, the code.
But, whatever, your code ...
I suspect the error is this line:
![]()
Set objShell = WScript.CreateObject("WScript.Shell")
because WScript is not defined.
If you had Option Explicit at the top of your code, it would have been highlighted when you tried to run the code.
Regards, TMS
Bookmarks