vba printout to pdf file

C

Curtis

Hi all,

I'm using xl2000 on a win2000 with adobe pdfwriter 5.0
to create from a .xls file a .pdf file.


Sub Macro1()
Application.activate = "Acrobat PDFWriter sur LPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, _
ActivePrinter:="Acrobat PDFWriter sur LPT1:", _
PrintToFile:= True, PrToFileName:="C:\test.pdf"
End Sub

What appens is that a file in c:\ is created but cant be viewed
because an error as occurred , no error number, and on desktop file
named test.pdf is created and viewable.

Whats going on I dont understand. Help!

Thanks!
Curtis
 
D

Dizabled

Hi Curtis,

I used "Acrobat Distiller" as printer instead of "Acrobat PDFWriter
sur LPT1:" and add the same problem.

The fact is that the file created by this command is postscript (*.ps)
file and not a pdf file. The postscript file can be converted to pdf
using the acrobat distiller.

It may seem confusing but just let me know by e-mail if you have
further question.

Math
 
S

Steve Rindsberg

Hi Curtis,

I used "Acrobat Distiller" as printer instead of "Acrobat PDFWriter
sur LPT1:" and add the same problem.

The fact is that the file created by this command is postscript (*.ps)
file and not a pdf file. The postscript file can be converted to pdf
using the acrobat distiller.

When you print to either of these drivers, Acrobat automatically creates a PDF
file. There's no need to have the application print to file and in fact if you
do that, it messes everything up, as you've seen.

Configure Acrobat/Distiller NOT to ask for a file name (ie, let it create the
name for you) and just print to the driver.

It may seem confusing but just let me know by e-mail if you have
further question.

Math

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Apologies for the delayed response.
Just back from PowerPoint Live 2004
Had a great time, learned a lot
================================================
 

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