Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
You can determine whether the VBA (Visual Basic for Applications) Project of your Excel file is protected using Aspose.Cells via the VbaProject.isProtected() property.
The following sample code creates a workbook and then checks if its VBA project is protected. It then protects the VBA project and checks again. Please see the console output for reference. Before protection, VbaProject.isProtected() returns false, but after protection, it returns true.
const AsposeCells = require("aspose.cells.node");
// Create a workbook.
const wb = new AsposeCells.Workbook();
// Access the VBA project of the workbook.
const vbaProj = wb.getVbaProject();
// Find out if VBA Project is Protected using isProtected method.
console.log("IsProtected - Before Protecting VBA Project: " + vbaProj.isProtected());
// Protect the VBA project.
vbaProj.protect(true, "11");
// Find out if VBA Project is Protected using isProtected method.
console.log("IsProtected - After Protecting VBA Project: " + vbaProj.isProtected());
This is the console output of the above sample code for reference.
IsProtected - Before Protecting VBA Project: False
IsProtected - After Protecting VBA Project: True
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.