Activate & De-activate Ribbon, Status Bar and Formula Bar in Excel
These codes can hide the ribbon, formula bar, status bar when you open a excel file and the second code will automatically restore all of them when you close the file.
Private Sub Workbook_Activate()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = Not Application.DisplayStatusBar
ActiveWindow.DisplayWorkbookTabs = False
End Sub
Private Sub Workbook_Deactivate()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
ActiveWindow.DisplayWorkbookTabs = True
End Sub
This VBA Code will help you to disable the SaveAs function in Excel
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then
MsgBox "The 'Save As' function has been disabled."
Cancel = True
End If
End Sub
This VBA Code will help you to disable the Auto Calculation mode in excel (for fast working in excel)
Private Sub Workbook_Open()
Application.Calculation = xlCalculationManual
End Sub
These codes can hide the ribbon, formula bar, status bar when you open a excel file and the second code will automatically restore all of them when you close the file.
Private Sub Workbook_Activate()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = Not Application.DisplayStatusBar
ActiveWindow.DisplayWorkbookTabs = False
End Sub
Private Sub Workbook_Deactivate()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
ActiveWindow.DisplayWorkbookTabs = True
End Sub
This VBA Code will help you to disable the SaveAs function in Excel
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then
MsgBox "The 'Save As' function has been disabled."
Cancel = True
End If
End Sub
This VBA Code will help you to disable the Auto Calculation mode in excel (for fast working in excel)
Private Sub Workbook_Open()
Application.Calculation = xlCalculationManual
End Sub
Comments
Post a Comment