Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "vous ne pouvez pas enregistrer ce claasseur" Cancel = True End Sub 'NB : Code à placer dans l'objet "ThisWorkbook" de ton classeur
Private Sub Workbook_BeforeClose(Cancel As Boolean) With Application.CommandBars("Standard") .Controls("Enre&gistrer").Enabled = True End With With Application.CommandBars("Worksheet Menu Bar") .Controls("Fichier").Enabled = True End With End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "vous ne pouvez pas enregistrer ce claasseur" Cancel = True End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionWith Application.CommandBars("Standard") .Controls("Enre&gistrer").Enabled = False End With With Application.CommandBars("Worksheet Menu Bar") .Controls("Fichier").Enabled = False End With