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?
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You know that SendKeys and reliable are contradictory? You should avoid using SendKeys as much as possible.
1
 
aikimarkCommented:
You can get the state from the GetKeyState Windows API
1
 
Mike in ITIT 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.