Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Save hidden Excel interfaces upon exiting Workbook

0

I copied VBA code from Teach Excel (displayed below) that works perfectly. The macros hides all the Excel ribbons, tabs, vertical and horizontal scrol bars, column and row headings so you are left with only your date on the screen.

My issue is that when I save the Workbook with everything hidden, close out of the Workbook and reopen it later, all the Excel ribbons, tabs, vertical and horizontal scrol bars, column and row headings are back so I have to run the Macro again to hide everything again.

I am looking for a way to hide everything, save the Workbook with everything hidden and then be able to reopen that document with everything still hidden as opposed to running thre Macro again.

Thank you for your time, Mark

Sub HideAll()

' Excel VBA Tutorial - https://www.TeachExcel.com

    ' Hide the Horizontal Scroll Bar

    ActiveWindow.DisplayHorizontalScrollBar = False

    ' Hide the Vertical Scroll Bar

    ActiveWindow.DisplayVerticalScrollBar = False

    ' Hide the Row/Column Headings

    ActiveWindow.DisplayHeadings = False

    ' Hide the Worksheet Tabs

    ActiveWindow.DisplayWorkbookTabs = False

    ' Hide the Status Bar (bottom of the window)

    Application.DisplayStatusBar = False

    ' Hide the Formula Bar

    Application.DisplayFormulaBar = False

    ' Hide the Ribbon Menu and Quick Access Toolbar

    Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"

    ' Display Full Screen

    'Application.DisplayFullScreen = True

End Sub

Answer
Discuss

Answers

0
Selected Answer

Mark

You can use the Workbook_Open event to launch that macro when the file opens.

In the ThisWorkbook module, add this code:

Private Sub Workbook_Open

Call HideAll

End Sub

Alternatively you can copy the code from HideAll into the Workbook_Open macro. 

Hope this helps- if so, please remember to mark this Answer as Selected 

Discuss

Discussion

Thanks for the code - that worked great!
marko14 (rep: 8) Mar 23, '23 at 10:09 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login