检查工作簿中的VBA项目是否已签名
Contents
[
Hide
]
您可以通过**工具 > 数字签名…**菜单命令,使用Microsoft Excel来检查您的VBA项目是否已签名。同样,您也可以使用Aspose.Cells的Workbook.VbaProject.IsSigned属性以编程方式来检查。
在C#中检查工作簿中的VBA项目是否已签名
以下代码加载工作簿并使用Workbook.VbaProject.IsSigned属性检查其VBA项目是否已签名。如果项目已签名,则该属性将返回true,否则将返回false。
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 + "Sample1.xlsx"); | |
Console.WriteLine("VBA Project is Signed: " + workbook.VbaProject.IsSigned); |