Check if VBA Code is Signed

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#

// 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