Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' terminer les constantes avec un anti-slash \
Const Chemin1 = "D:\EXCEL\@EXCEL-DOWNLOADS\" ' emplacement 1 du fichier ex: fichier source
Const Chemin2 = "M:\test\" ' emplacement 2 du fichier ex: fichier archive
Dim chemin As String, QuelChemin As String
Application.EnableEvents = False
Application.DisplayAlerts = True
' 1- le fichier actif est sauvegardé sur lui-même
On Error GoTo Error001
chemin = ThisWorkbook.Path
QuelChemin = chemin
If Right(chemin, 1) <> "\" Then chemin = chemin & "\"
ThisWorkbook.Save
' 2- le fichier actif est copié sur Chemin1
' si différent de Thisworkbook.fullname (idem pour chemin2)
QuelChemin = Chemin1
If LCase(chemin) <> LCase(Chemin1) Then ActiveWorkbook.SaveCopyAs Chemin1 & ThisWorkbook.Name
QuelChemin = Chemin2
If LCase(chemin) <> LCase(Chemin2) Then ActiveWorkbook.SaveCopyAs Chemin2 & ThisWorkbook.Name
Application.DisplayAlerts = True
Application.EnableEvents = True
Exit Sub
Error001:
MsgBox "ATENTION " & vbCrLf & vbCrLf & "Le fichier actif n'a pas été sauvegardé sur : " & _
vbLf & chemin & "" & vbCrLf & vbCrLf & "Veuillez vérifier que le support " & _
"externe ou réseau est accessible ou bien que le chemin existe"
Application.DisplayAlerts = True
Application.EnableEvents = True
Exit Sub
End Sub