AW: Exceltabelle in PDF umwandeln auf auf Desktop sp.
20.06.2012 20:46:01
KlausF
Hallo Thomas,
probier mal:
Sub speichern_unter_PDF()
Dim sPath As String
sPath = ThisWorkbook.Path 'ANPASSEN
If sPath = "" Then
MsgBox "Die Datei muß zuerst gespeichert werden"
Exit Sub
End If
sPath = IIf(Right$(sPath, 1) = Application.PathSeparator, sPath, sPath & Application. _
PathSeparator)
Dim rng As Range
Set rng = ActiveSheet.Range("A1:Q20") 'ANPASSEN
On Error GoTo ENDE
Application.DisplayAlerts = False
Dim PDF_NAME As String
PDF_NAME = sPath & "Export vom " & Format(Date, "dd.mm.yyyy") & ".pdf" 'ANPASSEN
If Not PDF_NAME = "Falsch" Then
rng.ExportAsFixedFormat Type:=xlTypePDF, FileName:=PDF_NAME, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End If
ENDE
Application.DisplayAlerts = True
End Sub
Gruß
Klaus