18.07.2018, 12:25
Hallo, :19:
probiere es mal so: :21:
probiere es mal so: :21:
Code:
Option Explicit
Public Sub Main()
Dim varPath As Variant
On Error GoTo Fin
varPath = Application.GetSaveAsFilename( _
InitialFileName:=ThisWorkbook.Path & "\" & Range("G6").Value & "_" & _
Range("G10").Value & "_" & Range("G8").Value, _
FileFilter:="PDF(*.pdf), *.pdf", _
Title:="Speichern als PDF")
If Not varPath = False Then
With ThisWorkbook.Worksheets("Beispiel")
.PageSetup.Orientation = 2
.PageSetup.Zoom = False
.PageSetup.FitToPagesWide = 1
.PageSetup.FitToPagesTall = 1
.Range("B2:X48").ExportAsFixedFormat 0, varPath, OpenAfterPublish:=True
End With
Else
MsgBox "Abbrechen geklickt..."
End If
Fin:
If Err.Number <> 0 Then MsgBox "Error: " & _
Err.Number & " " & Err.Description
End Sub