Bonjour noob40
Il y a une erreur dans le code précédent quand vous appuyez sur : Annuler dans le boite de dialogue
Et voila la correction
Sub Enregistrer_Une_Copie()
Dim ENDROIT As String, Nom_De_Fichier As String
N1 = Range("C4").Text ' le contenu de la cellule C4
If N1 = "" Then Exit Sub
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = "C:\"
If .Show = -1 Then
ENDROIT = .SelectedItems(1) & "\"
On Error GoTo 100 'Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ThisWorkbook.ActiveSheet.Copy
Nom_De_Fichier = N1 & "_" & Format(Date, "ddMMyy") & "_S_BP.xlsx"
With ActiveWorkbook
.ActiveSheet.DrawingObjects.Delete
.SaveAs Filename:=ENDROIT & Nom_De_Fichier
.Close
MsgBox "Votre base de données est sauvegardée dans le chemin : " & Chr(10) & ENDROIT, vbInformation, ""
End With
Else
End If
End With
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Exit Sub
100
End Sub