Need to password protect Excel sheets as they are converted to PDF

worthm

New Member
Joined
Mar 18, 2014
Messages
37
Hello,
I'm using Office 2010 and I have a dashboard with about 22 sheets in a workbook. At the start of each month I finalize the numbers for the prior month, then dump all of the sheets into their own PDFs with this piece of VB code:


Option Explicit
Private Sub Button9_Click() '<---Rename as appropriate mwmmm
Dim myPath As String, FileName As String
Dim sht As Worksheet
Dim wrk As Workbook
Set wrk = ThisWorkbook
myPath = "V:\Arizona CSRs\Dashboard\Team PDFs\Phoenix\" '<---Save the PDF here
For Each sht In wrk.Worksheets
'Execute on every sheet except the Welcome Screen
If sht.Name <> "Passwords" Then '<---Skip this Worksheet
FileName = sht.Name & ".Pdf" '<---Name the PDF
sht.ExportAsFixedFormat Type:=xlTypePDF, FileName:=myPath & FileName, Quality _
:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End If
Next sht
End Sub

I got this from a forum and it works well but the dashboard is growing. Once the dump into PDF is done I go in and manually add a password to each using Adobe Acrobat 8.0. This used to be easy with ten employees but now I have about 40 employee sheets and there ought to be an easier way. I have a sheet on the workbook with the list of passwords. How can I automate the task of adding the password to each PDF?

Thanks in advance for any help

I am not a programmer
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,195,848
Messages
6,011,946
Members
441,657
Latest member
Diupsy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top