Greetings,
I am running the following macro on Workbook Open. All is good in that it minimizes the ribbon. However, if an other Workbook is opened before this Workbook is opened and the Ribbon is minimized in that Workbook, the code will maximize the ribbon - creating an opposite effect.
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim wSheetName As Worksheet
For Each wSheetName In Worksheets
If wSheetName.Visible = xlSheetVisible Then
wSheetName.protect Password:="frank", UserInterFaceOnly:=True
End If
Next wSheetName
Application.CommandBars.ExecuteMso "MinimizeRibbon"
ActiveWindow.DisplayHorizontalScrollBar = False
ActiveWindow.DisplayVerticalScrollBar = False
ActiveWindow.DisplayHeadings = False
Application.DisplayFormulaBar = False
Worksheets("MainOpen").Activate
Worksheets("MainOpen").Select
ActiveSheet.ScrollArea = "A1:V1"
Range("V1").Select
ActiveWindow.Zoom = 100
Application.Run ("Unprotect_SOW")
Application.ScreenUpdating = True
End Sub
Bookmarks