December 20, 2017

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

 

2 thoughts on “Convert Excel File to Password Protected PDF File with VBA

  1. Hello Dinesh Sir,

    It was very useful to see your videos on excel formulas and VBA. i generally follow your videos.

    Well i required to know that can we have something like having a delete or copy function in effect after a specific time is elapsed. For eg. if i need to copy the contents from one column to another after every 5 seconds. This is for those excel sheets which are continuosly changing data in real time as that is connected to a software like ECG machine, Share Trading etc.

    Would like to hear from you.

    Thanks.

Comments are closed.