Hiding all tool bars/Menus in Excel

RiazShahid

New Member
Joined
Feb 20, 2009
Messages
21
Can any one please let me know how I can hide all the tool bars/ Menus in Excel, except the one I created for myself.
The tool bars must remain hide untill I close this workbook.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Code:
Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
    For Each oCB In Application.CommandBars
        oCB.Enabled = True
    Next oCB
    
    Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
    For Each oCB In Application.CommandBars
        oCB.Enabled = False
    Next oCB
    
    mFormulaBar = Application.DisplayFormulaBar
    Application.DisplayFormulaBar = False
End Sub

This is workbook event code.
To input this code, right click on the Excel icon on the worksheet
(or next to the File menu if you maximise your workbooks),
select View Code from the menu, and paste the code
 
Upvote 0
WOW!
It really works....But in this case there is no too bar shown. How I will show mine. The name of my customized toolbar is "MyMenuBar"
 
Upvote 0
Code:
Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
    For Each oCB In Application.CommandBars
        oCB.Enabled = True
    Next oCB
    
    Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
    For Each oCB In Application.CommandBars
        oCB.Enabled = False
    Next oCB

   Application.Commandbars("MyMenuBar").Enabled = True
    
    mFormulaBar = Application.DisplayFormulaBar
    Application.DisplayFormulaBar = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,539
Messages
6,114,221
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top