We are trying to automate the creation of PDF files for each sheet in an Excel file,a nd keep getting error messages. Can someone help? It produces the post script file, but it has no data nd then doesn't create a PDf file at all. We have Excel 2003, and have the below code setup.
Set appDist = New cAcroDist
Sheets("CAD Roll").Select
InputPSFileName = "\\nanflp03\cola\123g\coladmin\Dreamweaver\New Albany CMA\Reports\Today\RollCAD.ps"
OutPutPDFFileName = "\\nanflp03\cola\123g\coladmin\Dreamweaver\New Albany CMA\Reports\Today\RollCAD.pdf"
Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat PDFWriter on LPT1:", PrintToFile:=True, Collate:=True, PrToFileName:="\\nanflp03\cola\123g\coladmin\Dreamweaver\New Albany CMA\Reports\Today\RollCAD.ps"
Call appDist.odist.FileToPDF(InputPSFileName, OutPutPDFFileName, sjobOptions)
Kill InputPSFileName
We also have a class module setup called cAcroDist with the below code.
Option Explicit
Public WithEvents odist As PdfDistiller
Private Sub Class_Initialize()
Set odist = New PdfDistiller
End Sub
Bookmarks