Microsoft Excel

Ron de Bruin
Excel Automation

Microsoft MVP Program

Disable Excel 2003 Menu Accelerators keys in Excel 2007-2013

In Excel 2007-2013 you can still use the old shortcuts to the Excel 2003 menu controls.
For example Alt ti will popup the Add-ins dialog in Excel 2003 and also in Excel 2007-2013.

When you press Alt t in Excel 2007-2013 you see this on the ribbon.

When you press the i it will open the add-ins dialog.

Another example is Alt tms to open the Macro settings dialog.
But what if you want to build a dictator workbook and want to have full control?

Below you can find code to disable and enable the 2003 accelerator keys in 2007-2013.
In Excel 2003 you can disable the menu or control but in Excel 2007-2010 we must change the caption of the control because if you disable the menu or control the keys still work.

Copy the two macros below in a standard module of your workbook.

Sub Disable_2003_Accelerators_keys_In_Excel_2007_2013()
'Disable the Excel 2003 Accelerators keys in Excel 2007-2013
'Thanks to Tony Jollans
    Dim Ctl As CommandBarControl
    For Each Ctl In Application.CommandBars("&Legacy Keyboard Support").Controls
        Ctl.Tag = Ctl.Caption
        Ctl.Caption = Replace(Ctl.Caption, "&", "")
    Next
End Sub

Sub Enable_2003_Accelerators_keys_In_Excel_2007_2013()
'Enable the Excel 2003 Accelerators keys in Excel 2007-2013
'Thanks to Tony Jollans
    Dim Ctl As CommandBarControl
    For Each Ctl In Application.CommandBars("&Legacy Keyboard Support").Controls
        Ctl.Caption = Ctl.Tag
    Next
End Sub

You can also use this to reset the menu if the Enable macro is not working.

 Application.CommandBars("&Legacy Keyboard Support").Reset

 

Tip: If you want to disable the keys only for one workbook you can place the code
in the Activate and Deactivate event in the ThisWorkbook module of that file.
See this page if you not know where to paste the code

Private Sub Workbook_Activate()
    Call Disable_2003_Accelerators_keys_In_Excel_2007_2013
End Sub

Private Sub Workbook_Deactivate()
    Call Enable_2003_Accelerators_keys_In_Excel_2007_2013
End Sub

 

Check out MVP Tony Jollans site for information about Word.
http://www.wordarticles.com/Shorts/Accelerators/Accelerators.php