Ich brauche Hilfe bei einem Code
Unzwar klappt bei mir die abfrage nicht ob die Datei schob vorhanden ist damit weiter gespeichert wird.
Hoffe mir kann hier einer weiter helfen
Hier der Code...
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
Dim DateiSuche, Versuch
Application.DisplayAlerts = False
Application.EnableEvents = False
Versuch = 0
DateiSuche = Dir(ThisWorkbook.Path & "\Sicherung\" & [H7].Value & Format(Now, "_DD.MM.YYYY_hh. _
mm._* ")
Do Until DateiSuche = ""
' .Print DateiSuche
DateiSuche = Dir()
Versuch = Versuch + 1
Loop
ActiveWorkbook.SaveCopyAs Filename:=ThisWorkbook.Path & "\Sicherung\" & [H7].Value & Format(Now, _
"_DD.MM.YYYY_hh.mm._") & Versuch & ".xlsm"
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub