Sendkeys will change the status of Numlock

K

Kenneth Lam

Hi,

I am using SENDKEYS to help to enter data into Peachtree (an
accounting program). I have set the sequence of the data entry exactly
the same as if the data was entered by me using the keyboard. So the
result in Peachtree is the same.

The different is that when EXCEL using sendkeys to send the keystroke,
the NUMLOCK status will on and off and on and off. So after the
current data are all passed to Peachtree and go back to EXCEL, I have
to look at the number lock status and turn it on if it is off, before
I can use the kkeypad to enter another data. No all the time will off.
So I have to check it every time after the VBA has run.

I have tried this in other program (IE / NOTEPAD / ACDSee) and have
the same problem. Any suggestions on anything I have done wrong?

Thanks.
 
V

Vic Eldridge

Take a look here,
http://support.microsoft.com/default.aspx?scid=kb;en-us;179987

If that doesn't help then you might want to completely do away
with Sendkeys and use pure APIs to do the job. In most cases you
can use functions like EnumWindows & EnumChildWindows to drill down
to a particular textbox within an app and then use SendMessage to
write text to it. It's a lot trickier than Sendkeys but a lot more
robust too.
I'm sure the folks over at microsoft.public.vb.winapi would be glad to help.


Regards,
Vic Eldridge
 
K

Kenneth Lam

On 2 Jun 2004 19:06:28 -0700, (e-mail address removed) (Vic Eldridge)
wrote:

Thanks a lot! I think that is the problem I have.
 
K

Kenneth Lam

Thanks very much.

I have just tried this but it doesn't work in my Excel 2000. Maybe it
is for Excel 5 only.

Best Regards.
 
D

Dave Peterson

It worked ok for me in xl2002 and win98.



Kenneth said:
Thanks very much.

I have just tried this but it doesn't work in my Excel 2000. Maybe it
is for Excel 5 only.

Best Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top