Solved

Excel VBA - need a reliable method for SendKeys Number lock

Posted on 2016-11-28
4
30 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
4 Comments
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 125 total points
Comment Utility
You can get the state from the GetKeyState Windows API
1
 
LVL 68

Accepted Solution

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

Assisted Solution

by:Mike in IT
Mike in IT earned 125 total points
Comment Utility
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
Comment Utility
Thanks. I've taken Qlemo's advice and am NOT using SendKeys.
I shall try Mike in IT's link later.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now