Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("worksheet menu bar").Enabled = True '顯示菜單欄
Application.CommandBars("Formatting").Visible = True '顯示格式工具欄
Application.DisplayFormulaBar = True '顯示編輯欄
Application.CommandBars("Standard").Visible = True '顯示常用工具欄
Application.CommandBars("PivotTable").Visible = True '顯示數(shù)據(jù)透視表工具欄
Application.CommandBars("Visual Basic").Visible = True '顯示Visual Basic工具欄
ActiveWindow.DisplayWorkbookTabs = True '顯示工作表標(biāo)簽欄
End Sub
Private Sub Workbook_Open()
Application.CommandBars("worksheet menu bar").Enabled = False '隱藏菜單欄
Application.CommandBars("Formatting").Visible = False '隱藏格式工具欄
Application.DisplayFormulaBar = False '隱藏編輯欄
Application.CommandBars("Standard").Visible = False '隱藏常用工具欄
Application.CommandBars("PivotTable").Visible = False '隱藏數(shù)據(jù)透視表工具欄
Application.CommandBars("Visual Basic").Visible = False '隱藏Visual Basic工具欄
ActiveWindow.DisplayWorkbookTabs = False '隱藏工作表標(biāo)簽欄
End Sub