Private Sub Workbook_BeforeClose(Cancel As Boolean)
'-------------------------------------------------------------
' Proteger toutes les feuilles d'un classeur
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For i = 1 To nombre
Worksheets(i).Protect Password:="xxx"
Next i
'Proteger le classeur
ActiveWorkbook.Protect "xxx", True, True
'-------------------------------------------------------------
End Sub