How to remove the standard menus?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

My case is I want to remove all the standard menus and add my own one

Clara
 
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False


and

Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar


to put them back

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Hi Clara,

I am no expert on VB but a simple way is to add this bit of code to the
'ThisWorkbook' part of the VB editor

Private Sub Workbook_Open()
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("Reviewing").Visible = False
Application.CommandBars("Standard").Visible = False
Application.DisplayStatusBar = False
Application.DisplayCommentIndicator = 0
End sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Drawing").Visible = True
Application.CommandBars("Reviewing").Visible = True
Application.CommandBars("Standard").Visible = True
Application.DisplayStatusBar = True
Application.DisplayCommentIndicator = 0
End sub

so when your workbook is opened all the standard toolbars are removed, but
when you close they are added back.

There is probably a much simpler way of doing this, but its a start
regrds
 
Clara,

also to show your own toolbar, you would add this code to the Workbook open
part

Application.CommandBars("your toolbar name here").Visible = True

then ..

Application.CommandBars("your toolbar name here").Visible = False

in the workbook close part

rgds
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top