VB problem for distiller 6 and excel 2003

V

VB idiot

I have used a code as shown below to create PDF file from excel. The
code doesn't work on the version of Excel 2003. Error message comes up
at the line 'Set myPDF = New PdfDistiller' with 'Run-time error
'-2147024893' Automation error The system cannot find the path
specified'. VB can identify PdfDistiller as an object. Can somebody
help me here please?

Dim PSFileName As String
Dim PDFFileName As String
Dim LogFileName As String
PSFileName = archive_file_path & "\a " & datestring & ".ps"
PDFFileName = archive_file_path & "\a " & datestring & ".pdf"
LogFileName = archive_file_path & "\a " & datestring & ".log"

space_for_graph = space_for_graph - offset_space + const_space

' Generate postscript file from excel file
Range("A1:p" & space_for_graph).PrintOut copies:=1, preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prtofilename:=PSFileName

' convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""
Kill (PSFileName)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top