I have been using Excel 2003 to produce spreadsheets for others to use which necessitated deleting menu items from the standard menu bar. I now need to update this code for use with Excel 2010.
Here are examples of the type of thing I was doing in Excel 2003 (via auto_open) ... which worked fine.
MenuBars(xlWorksheet).Menus("Window").Delete
MenuBars(xlWorksheet).Menus("Data").Delete
MenuBars(xlWorksheet).Menus("Tools").Delete
MenuBars(xlWorksheet).Menus("Format").Delete
When the application closed (via auto_close), I used the code:
MenuBars(xlWorksheet).Reset
to reset the menus.
I realised these lines of code would not be correct for Excel 2010, so I tried the following:
CommandBars("Worksheet menu bar").Controls("Insert").Delete
CommandBars("Worksheet menu bar").Controls("Data").Delete
… but to no avail. The code is accepted (well there are no complaints), but nothing happens. The menu items are still visible when I open the application.
Can anyone help please. TIA
….. Andre Francis
Bookmarks