Dim EnCours As Boolean
Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
Dim Nom As String
Dim file_name As Variant
Dim LValue As String
Dim réponse As Integer
Application.Dialogs(xlDialogSaveAs).Show
réponse = MsgBox("admin?", vbYesNo)
If réponse = vbYes Then Exit Sub
If réponse = vbNo Then
LValue = Format(Range("C1"), "yyyy-mm-dd")
Nom = LValue & " - " & "Maison.xls"
If EnCours = True Then Exit Sub
EnCours = True
Application.DisplayAlerts = False
file_name = Application.GetSaveAsFilename(Nom, _
FileFilter:="Excel Files,*.xls,All Files,*.*", _
Title:="Save As File Name")
If file_name = False Then Exit Sub
ThisWorkbook.SaveAs ThisWorkbook.Path & "\" & Nom
Application.DisplayAlerts = True
Cancel = True
EnCours = False
End If
End Sub