Hide ribbon when excel opens - excel 2016

Viewed 3598

I am trying to hide my ribbons upon my workfile opening.

I've followed the below link but keep getting run-time error 91. VBA auto hide ribbon in Excel 2013

I've written the following code on the "thisworkbook" mode, but cannot get the line to work.

 Private Sub Workbook_Open()
 CommandBars.ExecuteMso "HideRibbon"
 End Sub
1 Answers

You need to add Application in front of CommandBars.

 Private Sub Workbook_Open()
    application.CommandBars.ExecuteMso "HideRibbon"
 End Sub
Related