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" & 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)
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" & 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)