Using SendKeys in a VBA subroutine toggles NumLock
I have added a subroutine call to the context-sensitive right-click menu in Excel. For purposes of my question, I've reduced the subroutine to:
Sub Test()
SendKeys("x")
End Sub
In this case, the subroutine simply puts an "x" in the active cell. However it inexplicably also toggles the NumLock status (from on to off or from off to on). No matter what keys are substituted for "x", NumLock is toggled. The only SendKeys statement that doesn't toggle NumLock is SendKeys(""), i.e., a null.
What could be causing this bizarre behavior?
|