1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
For s = 2 To Sheets.Count
Sheets(s).Visible = xlVeryHidden
Next s
If ActiveWorkbook.ReadOnly = True Then
SaveAsUI = False
Cancel = True
End If
End Sub
Private Sub Workbook_Open()
For s = 2 To Sheets.Count
Sheets(s).Visible = True
Next s
If ActiveWorkbook.ReadOnly Then
For Each WS In ActiveWorkbook.Worksheets
WS.Protect Password:="princesse", UserInterfaceOnly:=True
WS.EnableSelection = xlUnlockedCells
Next
End If
Sheets("Menu").Visible = True
Sheets("Menu").Select
With Application
.DisplayFullScreen = True
.DisplayFormulaBar = True
.DisplayStatusBar = True
.ActiveWindow.DisplayWorkbookTabs = True
End With
Application.OnTime Now + TimeValue("00:10:00"), "FermerClasseur"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub |
Partager