View Single Post
 
Old 08-18-2016, 04:41 AM
Neilesh Neilesh is offline Windows 10 Office 2013
Novice
 
Join Date: Aug 2016
Posts: 5
Neilesh is on a distinguished road
Default 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
Reply With Quote