Printing PDF files with VBA

PDF Creator is a super little tool which lets you print out any documents to a .pdf file. Once it’s installed all you have to do is select it from the print dialog and it will make you that PDF.

But what if you want to get hold of this functionally in your own code? No problemo! Like many 3rd party tools it has a full COM interface, so you can get hold of it with VBA.

Even better is that my Buddy Ken Plus of ExcelGuru.ca has put toghter a whole lot of information and code of precisely how to do it. Ken’s example can be found here:

Late Binding http://www.excelguru.ca/XLVBA/XLVBA12.htm
Early Binding http://www.excelguru.ca/XLVBA/XLVBA14.htm

Thanks Ken!

Comments

  1. Zack Barresse says:

    This is such a great utility to finally be able to use in Excel! In the upcoming Office 2007 it will probably become moot, but many users will not upgrade to 2007 for quite some time. I’m glad it will be available for those people. Ken did an excellent job on this one!

  2. ross says:

    Hi Zack!

    Yep, 07 will has pdf builit in, and i would guess it will be in the object model. Still just like you say, there will be a lot of people not up greading to 07 for a very long time so kens work will be very handy! ;-)

  3. TJM says:

    Excellent find! I look forward to using it in my code.

  4. Ken Puls says:

    Hello all!

    Ross, thanks for the link! I’m glad that everyone is finding it useful. :)

  5. This is great information! We use PDFCreator where I work and I had no idea that it could be accessed via VBA. This will make some of our Excel-based reporting much easier.

Submit a Comment