Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Problem with number lock

This is frustrating me beyond words....

I'm building an excel based tool around a number of userforms and the
problem is this:

The user enters is password into a textbox, hits enter... and then the
numberlock switches itself off... I don't get it, why is it doing this?

It's annoying because you have to keep reselecting number lock and this
makes the whole thing look very amateur... is there some code I can use to
turn it back on, or am I doing something stupid that's making it do it in the
first place?

I'm using excel 97,

Thanks, in anticpation...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with number lock

Not tried in Excel 97

Declare Sub SetKeyboardState Lib "USER32" (lpKeystate As Any)
Declare Sub GetKeyboardState Lib "USER32" (lpKeystate As Any)


Function TurnNumLockOn()
Dim lpbKeyState(128) As Long
GetKeyboardState lpbKeyState(0)
lpbKeyState(72) = 1
SetKeyboardState lpbKeyState(0)
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Black1" wrote in message
...
This is frustrating me beyond words....

I'm building an excel based tool around a number of userforms and the
problem is this:

The user enters is password into a textbox, hits enter... and then the
numberlock switches itself off... I don't get it, why is it doing this?

It's annoying because you have to keep reselecting number lock and this
makes the whole thing look very amateur... is there some code I can use

to
turn it back on, or am I doing something stupid that's making it do it in

the
first place?

I'm using excel 97,

Thanks, in anticpation...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Problem with number lock

Bob....

Thanks for your (very) quick response.

Unfortunately..... I can't get it to work, I get run time error 453 "Can't
find DLL entry point in USER32"





"Bob Phillips" wrote:

Not tried in Excel 97

Declare Sub SetKeyboardState Lib "USER32" (lpKeystate As Any)
Declare Sub GetKeyboardState Lib "USER32" (lpKeystate As Any)


Function TurnNumLockOn()
Dim lpbKeyState(128) As Long
GetKeyboardState lpbKeyState(0)
lpbKeyState(72) = 1
SetKeyboardState lpbKeyState(0)
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Black1" wrote in message
...
This is frustrating me beyond words....

I'm building an excel based tool around a number of userforms and the
problem is this:

The user enters is password into a textbox, hits enter... and then the
numberlock switches itself off... I don't get it, why is it doing this?

It's annoying because you have to keep reselecting number lock and this
makes the whole thing look very amateur... is there some code I can use

to
turn it back on, or am I doing something stupid that's making it do it in

the
first place?

I'm using excel 97,

Thanks, in anticpation...




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Problem with number lock

Okay, I've isolated the problem to the line

SendKeys ("{tab}")

Guess I'll take it out and find a work around.

Thanks anyway!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with number lock

You are using Sendkeys? That might be your original problem. There is an MS
article on that at

http://support.microsoft.com/default.aspx?kbid=179987
BUG: Multiple SendKeys Statement Turns Off NumLock Key

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Black1" wrote in message
...
Okay, I've isolated the problem to the line

SendKeys ("{tab}")

Guess I'll take it out and find a work around.

Thanks anyway!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Problem with number lock

Thanks Bob.

"Bob Phillips" wrote:

You are using Sendkeys? That might be your original problem. There is an MS
article on that at

http://support.microsoft.com/default.aspx?kbid=179987
BUG: Multiple SendKeys Statement Turns Off NumLock Key

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Black1" wrote in message
...
Okay, I've isolated the problem to the line

SendKeys ("{tab}")

Guess I'll take it out and find a work around.

Thanks anyway!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number Lock garzayd Excel Discussion (Misc queries) 1 May 7th 06 02:43 PM
Problem with File lock/unlock Slim Excel Discussion (Misc queries) 2 March 25th 05 09:45 AM
Protect and Lock Problem SOLVED!! Anon y mous Excel Programming 0 June 29th 04 06:08 AM
Cycle Number Lock Steve Garman Excel Programming 0 May 4th 04 08:54 AM
Lock/Unlock problem Jim[_34_] Excel Programming 3 January 17th 04 05:36 PM


All times are GMT +1. The time now is 09:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"