Previous | Next | (P-PDF) What's Wrong with my PDF?
Topic: Fails to complete print job
Conf: (P-PDF) What's Wrong with my PDF?, Msg: 140852
From: Jeiia
Date: 10/8/2005 12:01 AM
Dear all,
The script that I use for printing pdf-files from an workbook is the following:
'''''''''''''''''''''''''''''''''''''
Dim PSFileName As String
PSFileName = "" & Rapportsted & "myPostScript2.ps"
ActiveSheet.PrintOut copies:=1, preview:=False, ActivePrinter:="Acrobat Distiller", PrintToFile:=True, collate:=True, PrToFileName:=PSFileName
Dim PDFFileName As String
PDFFileName = "" & Rapportsted & "myPDF2.pdf"
Dim myPDF2 As PdfDistiller
Set myPDF2 = New PdfDistiller
myPDF2.FileToPDF PSFileName, PDFFileName, ""
Kill Rapportsted & "myPostScript2.ps"
Sourcefile = Rapportsted & "myPDF2.pdf"
Filename = Rapportnavn
FilePath = Rapportsted
DestinationFile = FilePath & Filename
FileCopy Sourcefile, DestinationFile
Kill Rapportsted & "myPDF2.pdf"
''''''''''''''''''''''''''''''''''
The Filename and FilePath are dynamic and are defined at the outset.
This usually works fine, but then it suddenly collaps and refuses to translate the postscript file into pdf-format. The message is that it is already in use - which makes no logical sense. Furthermore, the postscript becomes impossible to delete. (You need administrator rights to delete it).
What's wrong? Any ideas?
Regards