Private Sub Workbook_beforeclose(Cancel As Boolean)
Dim choix
If ThisWorkbook.ReadOnly = True Then 'cette partie fonctionne
MsgBox "Vos droits sur ce fichier ne vous permettent pas de le sauvegarder", vbExclamation
Application.ScreenUpdating = False
Sheets(1).Visible = True
For i = 2 To Sheets.Count
Sheets(i).Visible = xlVeryHidden
Next i
ThisWorkbook.Saved = True
Else
[B]choix = MsgBox("Voulez-vous enregistrer vos modifications ?", vbYesNo, "Enregistrement")
If choix = vbYes Then ThisWorkbook.Save
If choix = vbNo Then ThisWorkbook.Close SaveChanges:=False[/B]
End If
End Sub