print to pdf with vba

  • Thread starter Thread starter J Wait
  • Start date Start date
J

J Wait

How do you print to pdf in VBA and tell it where to save the pdf file and
what to name the pdf file. I can save as pdf in vba, but this does not pdf
the file correctly (different tabs save as different sizes in pdf and it's a
mess). Only printing (not saving) to pdf does it correctly.

When I record myself, it records:
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
 
J said:
How do you print to pdf in VBA and tell it where to save the pdf file and
what to name the pdf file. I can save as pdf in vba, but this does not pdf
the file correctly (different tabs save as different sizes in pdf and it's a
mess). Only printing (not saving) to pdf does it correctly.

When I record myself, it records:
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"

I used pdfcreator a lot for generating (aka printing) PDFs from VBA.

http://sourceforge.net/projects/pdfcreator/

Samples are included as far as I know. Have a look at
http://www.dailydoseofexcel.com/archives/2006/05/12/excel-pdfcreator/
for further assistance.

Stephan
 
Back
Top