问题
We use Titus for classification. I can save a macro in a local workbook, but I can't save anything to my universal PERSONAL.XLSB workbook. The Titus pop up won't go away no matter what options I choose.
The apparent cause is that Titus is trying to save to the wrong place, as shown in the picture below. Is there any fix for this other than disabling Titus? I'm on Win10, using Titus ClassificationSuite 4.5 HF3, Excel 2013. This exact macro saved to my personal.xlsb before my Win10 upgrade. (And by upgrade, I mean I got a new box with a fresh install)
回答1:
You may want to use EnableEvents=False before saving and then EnableEvents = True.
The Idea is to disable the events so the popup is supressed and then save the file. Once the save operation is done we'd want to enable the events.
Titus is a Com Addin and usually this is visible on the
Depending upon what you select the CustomDocumentProperties are set. You can find this by clicking File-->Info-->Adavnced Properties as shown here
Now this is how you'd add customProperties programatically
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
I hope this should give you an idea on how to go forward.
回答2:
I've found that if you edit the Personal.xlsb Workbook, and use the BeforeClose method such that:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.EnableEvents = False
End Sub
Then call the BeforeClose method to re-enable:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.EnableEvents = True
End Sub
来源:https://stackoverflow.com/questions/43122097/titus-add-on-wont-allow-me-to-save-to-personal-xlsb