تحقق مما إذا كان VBA Project محميًا ومؤمنًا للعرض
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
يسمح لك Aspose.Cells بالتحقق مما إذا كان ملف VBA (Visual Basic for Applications) Project of Excel محميًا ومغلقًا للعرض.
عينة من الرموز
يقوم نموذج التعليمات البرمجية التالي بتحميل ملفنموذج لملف Excel ويتحقق مما إذا كان ملف VBA (Visual Basic for Applications) Project of 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.getSharedDataDir(CheckifVBAProjectisProtectedandLockedforViewing.class) + "WorkbookVBAProject/"; | |
// Load your source Excel file. | |
Workbook wb = new Workbook(dataDir + "sampleCheckifVBAProjectisProtected.xlsm"); | |
// Access the VBA project of the workbook. | |
VbaProject vbaProject = wb.getVbaProject(); | |
// Whether "Lock project for viewing" is true or not. | |
System.out.println("Is VBA Project Locked for Viewing: " + vbaProject.getIslockedForViewing()); |
إخراج وحدة التحكم
هذا هو إخراج وحدة التحكم لنموذج التعليمات البرمجية أعلاه عند تنفيذه مع المتوفرنموذج لملف Excel.
Is VBA Project Locked for Viewing: true