检查VBA代码是否已签名
Contents
[
Hide
]
Aspose.Cells允许用户检查VBA代码项目是否已签名。请使用Workbook.VbaProject.IsSigned属性来检查VBA代码项目是否已签名。
以下代码解释了如何使用Workbook.VbaProject.IsSigned属性来检查VBA代码是否已签名。您可以使用任何Excel文件来测试此代码。为测试目的,您可以使用代码中使用的这个Excel文件。
在C#中检查VBA代码是否已签名
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); |
控制台输出
以下是上述代码的控制台输出,使用链接提供的示例Excel文件。
Is VBA Code Project Signed: True