PDF document with VBA?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hello

I'd like to create PDF documents with VBA. For this I downloaded the PDF995
writer. I created the following macro:

Sub Print_PDF()
ActiveSheet.PrintOut _
ActivePrinter:="PDF995 on Ne03:", _
PrintToFile:=True, _
PrToFilename:="C:\Temp\Test.pdf"
End Sub

The pdf file was created but I'm not able to open it with the Adobe Acrobat
Reader. The error message 'unknown format' appears. What am I doing wromg?

Tom
 
PDF995 prompts for a filename: I do not know of a way to default this.

You need to remove
PrintToFile:=True, _
PrToFilename:="C:\Temp\Test.pdf"

PDF995 prints postscript to a file and then this file is converted to PDF
without user interaction.

I think "C:\Temp\Test.pdf" contains the postscript: if you want to be sure,
you need a ps viewer: GHOSTVIEW is available on the internet.
 
Back
Top