Gruppe
Datei
Problem
Wie kann ich beim Speichern jeder Arbeitsmappe automatisch eine Sicherungsdatei erstellen?
StandardModule: basMain
Sub SaveAndBackup()
Dim sName As String, sMsg As String
On Error GoTo ERRORHANDLER
sMsg = "Bitte Pfad und Dateinamen angeben:"
sName = ActiveWorkbook.FullName
sName = InputBox( _
prompt:=sMsg, Default:=sName)
If sName = "" Then Exit Sub
ActiveWorkbook.SaveAs FileName:=sName, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=True
Exit Sub
ERRORHANDLER:
MsgBox "Datei konnte nicht gespeichert werden!"
End Sub