20-04-22 06:29 PM
21-04-22 03:39 PM
22-04-22 06:36 PM
18-05-23 01:26 PM
Hi All,
I have came across a requirement where I have to change the Excel file's Sensitivity label to Confidential before saving the file. Now I know the Excel VBA Code of it, however I was not able to make it workable via code stage. Can anyone help me on this?
--------------------------------------------------------------------------------------------------------------------------------
Here is the VBA Code:
Sub SetSensitivityLabelConfidential()
Dim myLabelInfo As Office.LabelInfo
Dim Context As Variant
Dim objWorkbook As Workbook
Dim SConfidential As String
Set objWorkbook = ActiveWorkbook
Set myLabelInfo = objWorkbook.SensitivityLabel.CreateLabelInfo()
Set Context = CreateObject("Scripting.Dictionary")
With myLabelInfo
.AssignmentMethod = MsoAssignmentMethod.PRIVILEGED '1
.ContentBits = 4
.IsEnabled = True
.Justification = "Write Your Reason"
.LabelId = "Your Organization alpha numberic code for Confidential type"
.LabelName = "Confidential"
.SetDate = Now()
End With
objWorkbook.SensitivityLabel.SetLabel myLabelInfo, Context
End Sub
--------------------------------------------------------------------------------
Thanks & Regards,
Pawan Panjwani
------------------------------
Pawan Panjwani
------------------------------
24-05-23 12:37 PM
Hi Members,
Can any one help me with the above issue.
Thanks & Regards,
Pawan Panjwani
18-07-23 05:41 PM
Did you find a solution? @PawanPanjwani1
19-07-23 02:38 PM
Yes Agustin, got the solution.
19-07-23 07:59 PM
could you tell me how you did it? @PawanPanjwani1
------------------------------
Agustin Rodolfo Catalano
Computing Engineering
Santander Argentina
America/Argentina/Buenos_Aires
------------------------------