Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default scrolllock key off


hello,

Can somebody tell me how to turn off the scrolllock key
when i start a excel folder (VBA)

Thanks


--
whizzz2004
------------------------------------------------------------------------
whizzz2004's Profile: http://www.excelforum.com/member.php...o&userid=33814
View this thread: http://www.excelforum.com/showthread...hreadid=535880

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default scrolllock key off

Try code like the following:


Declare Function GetKeyboardState Lib "user32" (pbKeyState As
Byte) As Long
Declare Function SetKeyboardState Lib "user32" (lppbKeyState As
Byte) As Long
Const C_SCROLL_LOCK_KEY = 145
Sub ScrollLockOn()
Dim lpbKeyState(256) As Byte
GetKeyboardState lpbKeyState(0)
lpbKeyState(C_SCROLL_LOCK_KEY) = 1
SetKeyboardState lpbKeyState(0)
End Sub


Sub ScrollLockOff()
Dim lpbKeyState(256) As Byte
GetKeyboardState lpbKeyState(0)
lpbKeyState(C_SCROLL_LOCK_KEY) = 0
SetKeyboardState lpbKeyState(0)
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"whizzz2004"
wrote
in message
...

hello,

Can somebody tell me how to turn off the scrolllock key
when i start a excel folder (VBA)

Thanks


--
whizzz2004
------------------------------------------------------------------------
whizzz2004's Profile:
http://www.excelforum.com/member.php...o&userid=33814
View this thread:
http://www.excelforum.com/showthread...hreadid=535880



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



All times are GMT +1. The time now is 11:59 AM.

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

About Us

"It's about Microsoft Excel"