xls_mycroft
New Member
- Joined
- Jul 13, 2011
- Messages
- 20
Hi all,
I stumbled across something odd: When opening a workbook in a macro that is triggered with a keyboard shortcut that includes the SHIFt key, the execution of this macro is ended directly after opening - without throwing an error. Running the same procedure normally (e.g. using a button or directly in VBE) or a keyboard shortcut without SHIFT everything works fine.
Example:
Running the above code via a keyboard shortcut that involves SHIFT will not produce any message box.
What I found so far:
* Same behavior across Excel 2003, 2007, 2010
* Shortcut: code execution only ends when SHIFT is part of the shortcut. Works with several letters.
Anybody has any idea where this is coming from?
Thanks for you help!
I stumbled across something odd: When opening a workbook in a macro that is triggered with a keyboard shortcut that includes the SHIFt key, the execution of this macro is ended directly after opening - without throwing an error. Running the same procedure normally (e.g. using a button or directly in VBE) or a keyboard shortcut without SHIFT everything works fine.
Example:
Code:
Sub test()
On Error GoTo ErrorHandler
Workbooks.Open("c:\temp\Book1.xlsx")
MsgBox "done"
Exit Sub
ErrorHandler:
MsgBox "Error: " & Err.Number & ":" & Err.Description
End Sub
Running the above code via a keyboard shortcut that involves SHIFT will not produce any message box.
What I found so far:
* Same behavior across Excel 2003, 2007, 2010
* Shortcut: code execution only ends when SHIFT is part of the shortcut. Works with several letters.
Anybody has any idea where this is coming from?
Thanks for you help!