Private Sub Workbook_Open()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.CommandBars("Formatting").Enabled = False
'----------------------------------------------------------------------------
Application.CommandBars("Cell").Enabled = False
ActiveWindow.DisplayHorizontalScrollBar = False
ActiveWindow.DisplayVerticalScrollBar = False
Application.DisplayFormulaBar = False
With Application
.WindowState = xlMaximized 'window max
End With
Application.DisplayFullScreen = True ' Plein écran
ActiveWindow.Zoom = 115
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
RétabliMenu
Application.DisplayFullScreen = False
ActiveWindow.Zoom = 100
End Sub
Sub RétabliMenu()
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveWorkbook.Protect Structure:=False, Windows:=False
For Each CmdBar In Application.CommandBars: CmdBar.Enabled = True: Next
With Application
.DisplayFullScreen = False 'Ecran normal
.DisplayFormulaBar = True 'Aff barre formule
.DisplayStatusBar = True 'Aff barre état
.DisplayScrollBars = True 'Aff barre defilement
.WindowState = xlMaximized 'window max
.ScreenUpdating = True
End With
With ActiveWindow
.DisplayHeadings = True 'Aff les titres Lig/Col
.DisplayWorkbookTabs = True 'Aff les onglets
'.DisplayGridlines = True 'Aff quadrillage
.WindowState = xlMaximized
End With
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Application.CommandBars("Formatting").Enabled = True
Application.CommandBars("Cell").Enabled = True
Application.ScreenUpdating = True
Application.EnableEvents = True
ActiveWindow.DisplayHorizontalScrollBar = True
Application.ScreenUpdating = False
Application.EnableEvents = False
End Sub