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