ich brauche bitte Hilfe bei einem VBA Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim SavePath As String
SavePath = "Y:\Sicherung"
ActiveWorkbook.Save
ActiveWorkbook.SaveAs SavePath & "\" & ActiveWorkbook.Name & "_" & Format(Date, "ddmmyy_") & _
Format(Time, "hhmm") & ".xlsm"
End Sub
Ich möchte, dass sich die Aktive Datei beim schließen automatisch als Kopie in einem anderen Ordner anlegt.Problemstellung: - "Y:" muss eine variable sein, da aktive Datei und Sicherungsordner auf dem Server liegt und immer anders ist.
Kann mir jemand helfen?
Vielen Dank im Voraus.