Solved

Excel VBA - need a reliable method for SendKeys Number lock

Posted on 2016-11-28
4
54 Views
Last Modified: 2016-12-01
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.
0
Comment
Question by:hindersaliva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 125 total points
ID: 41904565
You can get the state from the GetKeyState Windows API
1
 
LVL 70

Accepted Solution

by:
Qlemo earned 250 total points
ID: 41904608
You know that SendKeys and reliable are contradictory? You should avoid using SendKeys as much as possible.
1
 
LVL 7

Assisted Solution

by:Mike in IT
Mike in IT earned 125 total points
ID: 41904704
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
 

Author Closing Comment

by:hindersaliva
ID: 41909035
Thanks. I've taken Qlemo's advice and am NOT using SendKeys.
I shall try Mike in IT's link later.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question