Function Shift Pressed not working in Excel 2007

B

Barb Reinhardt

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
 
B

Barb Reinhardt

I just figured out the problem. The function IS working, but it takes a
while to open the file now and by then, the Shift key may be pressed again.
Not sure how to handle that though. Any ideas?
 

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