Return to VBA Code Examples

Excel VBA Save As (Print) to PDF

This tutorial will demonstrate how to save / print to a PDF in Excel VBA.

Print to PDF

This simple procedure will print the ActiveSheet to a PDF.

I’ve also created a function with error handling, etc. that will print the ActiveSheet to a PDF:

The function returns TRUE or FALSE if the print to PDF was successful or not.

Save and Email PDF Function

This function will save the ActiveSheet as a PDF and (optionally) attach the PDF to an email (assuming you have Outlook installed):