AW: Auswahl abbrechen
07.07.2018 12:52:52
Nepumuk
Hallo Eisi,
teste mal:
Option Explicit
Sub Schaltfläche1_Klicken()
Dim objFileDialog As FileDialog
Set objFileDialog = Application.FileDialog(msoFileDialogSaveAs)
With objFileDialog
.AllowMultiSelect = False
.FilterIndex = 25
.InitialFileName = "H:\Test1.pdf" 'anpassen !!!
.Title = "Als PDF speichern"
If .Show = -1 Then
Call ActiveSheet.Range("A2:AG65").ExportAsFixedFormat(Type:=xlTypePDF, _
Filename:=.SelectedItems(1), Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True)
End If
End With
Set objFileDialog = Nothing
End Sub
Sub Schaltfläche2_Klicken()
Dim objFileDialog As FileDialog
Set objFileDialog = Application.FileDialog(msoFileDialogSaveAs)
With objFileDialog
.AllowMultiSelect = False
.FilterIndex = 25
.InitialFileName = "H:\Test2.pdf" 'anpassen !!!
.Title = "Als PDF speichern"
If .Show = -1 Then
Call ActiveSheet.Range("A2:AG65,A67:AG133").ExportAsFixedFormat(Type:=xlTypePDF, _
Filename:=.SelectedItems(1), Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True)
End If
End With
Set objFileDialog = Nothing
End Sub
Gruß
Nepumuk