Microsoft Excel
Back to jkp-ads.com

Ron de Bruin
Excel Automation

Microsoft MVP Program

Disable Excel 2003 Menu Accelerators keys in Excel 2007-2016

Important message to visitors of this page

Ron de Bruin decided to remove all Windows Excel content from his website for personal reasons. If you want to know why, head over to rondebruin.nl.

Luckily, Ron was kind enough to allow me to publish all of his Excel content here.

Most of these pages are slightly outdated and may contain links that don 't work. Please inform me if you find such an error and I'll try to fix it.

Kind regards

Jan Karel Pieterse


In Excel 2007-2016 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-2016.

When you press Alt t in Excel 2007-2016 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-2016.
In Excel 2003 you can disable the menu or control but in Excel 2007-2016 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_2016()
'Disable the Excel 2003 Accelerators keys in Excel 2007-2016
'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_2016()
'Enable the Excel 2003 Accelerators keys in Excel 2007-2016
'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_2016
End Sub

Private Sub Workbook_Deactivate()
    Call Enable_2003_Accelerators_keys_In_Excel_2007_2016
End Sub

 

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