View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Function Shift Pressed not working in Excel 2007

I'm sure someone here steered me to this function when I was having some
issues programmatically opening excel workbooks when the shift key was
pressed. I've just migrated to Office 2007 and this function isn't working.

'Declare API
Declare Function GetKeyState Lib "User32" _
(ByVal vKey As Integer) As Integer
Const SHIFT_KEY = 16
Function ShiftPressed() As Boolean
'Returns True if shift key is pressed
ShiftPressed = GetKeyState(SHIFT_KEY) < 0
End Function

Can someone assist?

Thanks,
Barb Reinhardt