Convert Excel File to Password Protected PDF File with VBA

How to convert an Excel File to a password protected PDF file with VBA automatically free of cost. Saving an Excel File with password as a PDF file does not password protect the PDF file. Also exporting the Excel file as a PDF file does not password protect the final PDF file. It can be easily opened by Acrobat reader without a password. The method shown in our video ensures that the converted Excel file is a password protected file. It does not require expensive third-party software. In fact, the complete process of creating a password protected PDF file from an Excel worksheet is totally free.

Watch the video below.

 

 

Watch this video on YouTube.

Here’s the VBA code or macro:

Sub protectPDFWithPassword()
ActiveSheet.PrintOut ActivePrinter:=”PDFCreator”

End Sub

Further reading:

VBA: Excel / Word to PDF Encrypted / Password Protected