ich habe folgenden VBA-Code um eine Datei abzuspeichern!
Sub SpeichernUnter()
Dim DateiName As String
Dim Datum As Date
Datum = Range("G5").Value
ChDrive ("T")
ChDir ("T:\Bestandsaufnahme")
DateiName = "Bestand_" & Format(Datum, "mmyy") & ".xls"
With Application
.DisplayAlerts = False
.EnableEvents = False
End With
ActiveWorkbook.SaveAs Filename:=DateiName, FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
With Application
.DisplayAlerts = True
.EnableEvents = True
End With
End Sub
mit dem Format xls klappt das auch soweit! Wenn ich jetzt aber ein xlsm daraus mache kann ich die neue Datei nicht mehr öffnen! Excel sagt dann das Dateiformat ist ungültig! Wie mache ich es richtig?Gruß