Hi, newbie at vba.
The issue i am having is the ribbon is hidden on my current workbook (this is what i intended for this workbook), however when opening a new workbook with present one still open the ribbon/toolbar will not show e.g. to format, allign and so on.
My this workbook code is:
Private Sub Workbook_Open()
ActiveSheet.ScrollArea = "A1:A1"
Application.ScreenUpdating = True
Application.DisplayStatusBar = Not Application.DisplayStatusBar
Application.CommandBars("Worksheet Menu Bar").Enabled = False
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
With ActiveWindow
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With
ActiveSheet.DisplayPageBreaks = False
' Sub NoEsc()
Application.OnKey "{ESC}", "NoChange"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
ActiveWindow.DisplayWorkbookTabs = True
ActiveWorkbook.Close SaveChanges:=False
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then
MsgBox "The 'Save As' function has been disabled." & _
Chr(10) & "For Review Purpose Only, to request changes please use the email function.", vbInformation, "Save As Disabled"
Cancel = True
End If
End Sub
Bookmarks