Forumbeitrag
Excel-Version des Fragestellers:
2019
Erfahrungslevel des Fragestellers:
Kaum Excel/VBA-Kenntnisse
oder auch via .FileDialog so:
Sub SaveAsPDF_WithDialog()
Dim dPdf As FileDialog, targetFile$
Dim Pfad$: Pfad = "C:\MGD Recycling\Rechnungen\Ankauf-Verkauf\"
Set dPdf = Application.FileDialog(msoFileDialogSaveAs)
With dPdf
.Title = "PDF speichern unter..."
.AllowMultiSelect = False
.InitialFileName = ActiveSheet.Name & ".pdf"
If .Show <> -1 Then Exit Sub
targetFile = .SelectedItems(1)
End With
If LCase$(Right$(targetFile, 4)) <> ".pdf" Then
targetFile = targetFile & ".pdf"
End If
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Pfad & targetFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Gruß Uwe