Issue:
Upon me using SendKeys
to copy data from an Excel application to another (non-Microsoft) application, my Num Lock becomes disabled.
Sub Test()
Range("A1:B71").Select
SendKeys "^C" 'Copies Selected Text
AppActivate "AccuTerm 2K2"
SendKeys "2", True 'Enters to notes screen
SendKeys "^M", True 'Confirms above (Enter key)
SendKeys "^V", True 'Pastes into client application
Application.Wait (Now + TimeValue("0:00:05"))
'Providing time for client application to finish
'pasting...
SendKeys "^M", True 'Next three enters are to
SendKeys "^M", True '...exit notes section
SendKeys "^M", True
AppActivate "Microsoft Excel"
Range("B52:B62").Clear 'Clears the Template
Range("B52").Select 'Resets Cell Position
End Sub
Preferred Resolution:
What can be done to prevent my code from disabling the NumLock - or how can I go about re-enabling numlock once my code completes?
Use this to turn numlock back on. I forget where I found this on the internet. I did not author it.
Place this in a class module.
Use it like: