检查 VBA 代码是否已签名
Contents
[
Hide
]
Aspose.Cells 允许用户检查 VBA 代码项目是否已签名。请使用工作簿.getVbaProject().isSigned()检查 VBA 代码项目是否已签名的方法。
检查 VBA 代码是否已签名
下面的代码解释了如何使用工作簿.getVbaProject().isSigned()方法。您可以使用任何 Excel 文件来测试此代码。出于测试目的,您可以使用代码中使用的这个 excel 文件.
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-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(CheckVBAProjectInWorkbookIsSigned.class); | |
Workbook workbook = new Workbook(dataDir + "source.xlsm"); | |
System.out.println("VBA Project is Signed: " + workbook.getVbaProject().isSigned()); | |
控制台输出
下面是使用上述代码的控制台输出示例 excel 文件由链接提供。
Is VBA Code Project Signed: true