G Guest Mar 23, 2007 #1 Hi all, My case is I want to remove all the standard menus and add my own one Clara
B Bob Phillips Mar 23, 2007 #2 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)
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)
G Guest Mar 23, 2007 #3 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
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
G Guest Mar 23, 2007 #4 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
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