Full Version: Formatting Menu bar lost
UtterAccess Discussion Forums > Microsoft® Office > Microsoft Excel
Tomo1
I seem to have lost the Formatting Menu bar from Excel, to the point where it is not even on the list of toolbars I can reselect.

I have identified that it is down to a specific Excel file that I have created, where I am trying to control which menus are available. Is it possible to programmatically retrieve the Formatting menu, since everyone that opens it is now losing their Formatting toolbar?

As a point of reference the only the code I can think of that may be affecting things is in the on open of 'This Workbook' module.

Application.CommandBars(4).Enabled = False
Application.CommandBars("Edit").Enabled = False
Application.CommandBars("Data").Enabled = False
Application.CommandBars("View").Enabled = False
Application.CommandBars("Window").Enabled = False

Application.CommandBars("Format").Controls("Row").Enabled = False
Application.CommandBars("Format").Controls("Column").Enabled = False
Application.CommandBars("Format").Controls("Sheet").Enabled = False
Application.CommandBars("Format").Controls("AutoFormat...").Enabled = False
Application.CommandBars("Format").Controls("Conditional Formatting...").Enabled = False
Application.CommandBars("Format").Controls("Style...").Enabled = False
Application.CommandBars("Shortcut").Enabled = False

I obviously have the reverse Enabled = true in the close procedure.
sas_xpert
Your Correct in your starting Point

Application.CommandBars(4).Enabled = False
Command Bar 4 is the Formatting Toolbar



This little code snippet will give you the name, number and visibility of all the Bars
CODE


Sub NameNNumberCmdBars()
' Ask each commandbar for it's name and number and status...
Dim cmdbr As CommandBar

For Each cmdbr In Application.CommandBars
Debug.Print cmdbr.Index, cmdbr.Name, cmdbr.Visible

Next cmdbr

End Sub
Tomo1
That's excellent, thanks.....

But......can I now do the same for individual controls??? Such as Insert on the Worksheet Menu Bar????
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.