检查 VBA 代码是否已签名

下面的代码解释了如何使用工作簿.VbaProject.IsSigned财产。您可以使用任何 Excel 文件来测试此代码。出于测试目的,您可以使用代码中使用的这个 excel 文件.

检查 VBA 代码是否在 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);

控制台输出

下面是使用上述代码的控制台输出示例 excel 文件由链接提供。

Is VBA Code Project Signed: True