Save file as with VBA in Microsoft Excel

In the dialog for saving a file, a single file name can be preset, among other things.

Sub DateiSpeichernUnter()
Dim Erfolg As Boolean
Workbooks.Add
Erfolg = Application.Dialogs(xlDialogSaveAs). _
Show(arg1:="Test.xlsx")
If Not Erfolg Then _
MsgBox "Keine Datei ausgewählt"
End Sub

Die Konstante ist xlDialogSaveAs . Falls der Benutzer nur den Button Speichern betätigt, wird die neu erzeugte Datei unter dem Namen Test.xlsx gespeichert.

In den Versionen vor Excel 2007 muss die Dateibezeichnung in der Prozedur und in der Erläuterung wie folgt lauten: Test.xls.

Was the explanation to "Save file as with VBA in Microsoft Excel"Helpful? Rate now:

More explanations too