您可能希望在保存之前使用 EnableEvents=False,然后使用 EnableEvents = True。
想法是禁用事件,以便抑制弹出窗口,然后保存文件。保存操作完成后,我们希望启用事件。
Titus 是一个 Com 插件,通常在 上可见
根据您选择的内容设置 CustomDocumentProperties。您可以通过单击文件-->信息-->高级属性来找到它,如下所示
现在这就是您以编程方式添加 customProperties 的方式
Application.EnableEvents = False
With ActiveWorkbook.CustomDocumentProperties
.Add "CompanyClassification", False, msoPropertyTypeString, "Company-Public"
.Add "CompanyClassification", False, msoPropertyTypeString, "Company-Internal"
.Add "CompanyClassification", False, msoPropertyTypeString, "Company-Confidential"
.Add "CompanyClassification", False, msoPropertyTypeString, "Company-Secret"
End With
'Do the Save Operation here. Also if your company wants to Comply with EU GDPR (European General Data Protection Regulatory) then add the appropriate footer (Internal/Public/....)
Application.EnableEvents = True
我希望这能让您对如何前进有所了解。