Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,118 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello .
I have written a VBA script from a MS Visio file.
In this script, I am creating an excel file from a Visio Report, and need to assign a sensitivity label (as requirement by my company) before saving it.
I use the code below.
It works fine when I use debug / step by step mode.
But when I run it, I get the following error on the last line of code
Anybody can help me?
Thx
Dim Context As Variant
Set Context = CreateObject("Scripting.Dictionary")
Dim LBInfo As Office.LabelInfo
Set LBInfo = objExcel.SensitivityLabel.CreateLabelInfo()
With LBInfo
.AssignmentMethod = MsoAssignmentMethod.PRIVILEGED
.LabelName = "company Confidential"
.ContentBits = 4
.IsEnabled = True
.SetDate = Now()
.LabelId = "my company label...." ' company confidential Label
End With
objExcel.SensitivityLabel.SetLabel LBInfo, Context