Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-26-2023, 09:27 AM
coffent coffent is offline Using SendKeys in a VBA subroutine toggles NumLock Windows 10 Using SendKeys in a VBA subroutine toggles NumLock Office 2019
Advanced Beginner
Using SendKeys in a VBA subroutine toggles NumLock
 
Join Date: Dec 2019
Posts: 40
coffent is on a distinguished road
Default 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?
Reply With Quote
 

Tags
numlock, sendkeys

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex Document Templates with Section Toggles and Multiple Fields damaniam Word 1 06-04-2019 06:49 PM
Using SendKeys in a VBA subroutine toggles NumLock SENDKEYS with vbYesNoCancel and Select Case kiwimtnbkr Word VBA 31 06-11-2018 04:56 AM
Using SendKeys in a VBA subroutine toggles NumLock Function or subroutine with counting memory paik1002 Word VBA 1 12-15-2015 01:28 AM
Using SendKeys in a VBA subroutine toggles NumLock A macro that can insert FILENAME, sendkeys CTRL ALT T, paste clipboard, and nextline kyjac85 Word VBA 13 09-20-2012 05:00 PM
Problem with the sendkeys in Win7 vidyapakki Excel Programming 1 05-07-2012 11:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft