I have VBA that hides my ribbon (seen below). My only problem is, when people open other workbooks, it hides their ribbon as long as the file that contains the code below is open. How do I make it so my hide ribbon code applies only to this workbook, even if one or more unrelated workbooks are open?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
Application.DisplayStatusBar = True
End Sub
Private Sub Workbook_Deactivate()
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
Application.DisplayStatusBar = True
End Sub
Private Sub Workbook_Open()
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
Application.DisplayFormulaBar = False
Worksheets("Menu").Select
Application.DisplayStatusBar = False
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False
If IsNumeric(Sh.Name) Then
Sh.ScrollArea = "A1:O30"
Else
Sh.ScrollArea = "A1:M12"
End If
End Sub
Bookmarks