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):


VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)