Encrypt PDF only for editing after conversion from excel
Hi Experts,
Here are below codes for converting the the file from excel to pdf with the required name of the file. Can you please provide the macro with the present macro for protecting the pdf after conversion from editing in any manner.
Private Sub CommandButton2_Click()
'saves the file as PDF and adds a date parameter to the name of the file
aux1 = ""
If Month(Date) < 10 Then
aux1 = "0"
End If
aux2 = ""
If Day(Date) < 10 Then
aux2 = "0"
End If
fileN = "Salary Slip of " & Workbooks.Application.Sheets("Salary Slip").Cells(10, 5).Value
fileD = Format(Sheets("Salary Slip").Cells(6, 2).Value, "mmm-yy")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.Path & "\" & fileN & " for " & fileD & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
Please help me out experts.
Regards,
Neilesh
|