ich bin auf der Suche nach Vereinfachung. Ca. 60 einzelne Excel-Reports sollen zu einem PDF-Gesamtreport zusammengefügt werden. Wer hat eine Idee, wie man die Generierung dieses PDF-Files aus verschiedenen Excel-Tabellen automatisieren könnte?
Chris
Sub RegisterDLL()
Dim lngCounter As Long
Dim objPDF As Object
Dim bolDLLInstalled As Boolean
bolDLLInstalled = False
With ThisWorkbook.VBProject.References
For lngCounter = 1 To .Count
If .Item(lngCounter).Name = "ACRODISTXLib" Then
bolDLLInstalled = True
End If
Next lngCounter
If bolDLLInstalled = False Then
Set objPDF = .AddFromGuid(strDistillerGUID, 1, 0)
End If
End With
Set objPDF = Nothing
End Sub
Sub PrintToPDF(strFileName As String, strOriginPath As String, strTargetPath As String)
Dim objDistiller As New ACRODISTXLib.PdfDistiller
objDistiller.bShowWindow = False
ActiveWindow.SelectedSheets.PrintOut , printtofile:=True, _
collate:=True, prtofilename:=strOriginPath & strFileName & ".ps"
objDistiller.FileToPDF strOriginPath & strFileName & ".ps", strTargetPath & strFileName & ".pdf", ""
Kill strOriginPath & strFileName & ".ps"
Set objDistiller = Nothing
End Sub
Sub Printing()
Call PrintToPDF("test", "C:\Excel\", "E:\PDF\")
End Sub