Excel VBA - need a reliable method for SendKeys Number lock

I see that {Numlock} toggles the Number lock.

I'm looking for a reliable way to ensure that, after my Sendkeys {Down} which sometimes leaves Number Lock state as 'off', to ensure that it is returned to Number Lock 'on'.

Thanks.
hindersalivaAsked:
Who is Participating?
 
QlemoConnect With a Mentor DeveloperCommented:
You know that SendKeys and reliable are contradictory? You should avoid using SendKeys as much as possible.
1
 
aikimarkConnect With a Mentor Commented:
You can get the state from the GetKeyState Windows API
1
 
Mike in ITConnect With a Mentor IT System AdministratorCommented:
I agree with Qlemo, you should avoid SendKeys. It is not reliable. Here is a link to a possible way to work around it with an API.
0
 
hindersalivaAuthor Commented:
Thanks. I've taken Qlemo's advice and am NOT using SendKeys.
I shall try Mike in IT's link later.
0
All Courses

From novice to tech pro — start learning today.