The following saves the activesheet as a PDF:
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\blahblah2.pdf", _
Quality:=xlQualityStandard, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
I need to be able to create a password protected PDF - is this possible using VBA without buying any additional software?
I used PDFsharp
using VS
- my project is in C#
... this free library works very well
来源:https://stackoverflow.com/questions/12373631/vba-to-save-a-sheet-to-a-password-protected-pdf