Check if VBA Code is Signed
Contents
[
Hide
]
Aspose.Cells allows the user to check if the VBA code project is signed or not. Please use the Workbook.VbaProject.IsSigned property to check if the VBA code project is signed or not.
The following code explains how to check if the VBA code is signed or not using the Workbook.VbaProject.IsSigned property. You can use any of your excel files to test this code. For testing purposes, you can use this excel file used in the code.
Check if VBA Code is Signed in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
Workbook workbook = new Workbook(dataDir + "sampleVBAProjectSigned.xlsm"); | |
Console.WriteLine("Is VBA Code Project Signed: " + workbook.VbaProject.IsSigned); |
Console Output
Below is the console output of the above code using the sample excel file provided by the link.
Is VBA Code Project Signed: True