Curios bug with keyboard shortcuts?!?

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:

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!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,225,070
Messages
6,182,672
Members
453,131
Latest member
BeLocke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top