I currently use the following code to output part of the Excel worksheet as PDF. I am wondering if it would be possible to also add a password to the PDF output.
Sub print_pdf()
Sheets(Array("Sheet1", "Sheet2")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ThisWorkbook.Path & "\" & NameOfWorkbook _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub