Hello Forum
I'm trying to write a code that hides Ribbon and menus when opening the workbook.
But there seems to be a bug - but where?
I get this message:
"Run-time error '438':
Object doesn't support this property or method"
Can somebody help ?
best regards
Morten Magni
Private Sub Workbook_Open()
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.ExecuteExcel4Macro "Show.Toolbar(""Ribbon"", False)"
.WindowState = xlNormal
.CommandBars("Full Screen").Visible = False
.CommandBars("Worksheet Menu Bar").Enabled = False
.DisplayStatusBar = False
.DisplayFormulas = False
.DisplayScrollBars = False
.Width = 845
.Height = 408
End With
With ActiveWindow
.DisplayWorkbookTabs = False
.DisplayRuler = False
.DisplayHeadings = False
.DisplayGridlines = False
End With
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
End Sub