Gruppe
Datei
Problem
Wenn ich beim Speichern die CheckBox "Sicherungsdatei erstellen" aktiviere, wird die BackUp-Datei im gleichen Verzeichnis wie die Arbeitsmappe erstellt. Kann ich hier ein anderes Verzeichnis vorgeben?
StandardModule: basMain
Sub SpeichernMitKopie()
Dim sPath As String, sFile As String, sName As String
sPath = Range("B1").Value
If Right(sPath, 1) <> "\" Then
sPath = sPath & "\"
End If
sName = ThisWorkbook.FullName
sFile = ThisWorkbook.Name
sFile = Left(sFile, Len(sFile) - 1) & "bak"
ThisWorkbook.SaveAs sPath & sFile
ActiveWorkbook.SaveAs sFile
End Sub