【问题标题】:Excel VBA SaveAs "Read-only" PDF fileExcel VBA 另存为“只读”PDF 文件
【发布时间】:2022-01-24 08:34:15
【问题描述】:

以下代码成功地将 Excel 工作表另存为 PDF。我想将它保存为一个文件,每个人都可以打开,但不能使用 Adob​​e Acrobat Reader DC 提供的“填充和签名”功能进行编辑。我试图简单地添加以下内容,但这不起作用:

Attributes:=vbReadOnly

下面是剩下的代码:

Dim sPath As String

sPath = "O:\"

With Worksheets("Sheet 1")
    .ExportAsFixedFormat _
        Type:=xlTypePDF, _
        Filename:=sPath & UserForm.TextBox1.Value & ".pdf", _
        Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, _
        IgnorePrintAreas:=False, _
        OpenAfterPublish:=False
End With

【问题讨论】:

    标签: excel vba pdf


    【解决方案1】:

    保存后应该可以使用SetAttr了。

    SetAttr "c:\path\yourfilename.pdf", vbReadOnly
    

    【讨论】:

    • 不工作,我仍然可以填写并签署 pdf 文件
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-15
    • 1970-01-01
    • 2018-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-28
    相关资源
    最近更新 更多