Find out if VBA Project is Protected

Find out if VBA Project is Protected in Python

You can determine whether the VBA (Visual Basic for Applications) project of your Excel file is protected using Aspose.Cells for Python via .NET by using the VbaProject.is_protected property.

Sample Code

The following sample code creates a workbook and then checks whether its VBA project is protected. It then protects the VBA project and checks again whether the VBA project is protected. Please see the console output for reference. Before protection, VbaProject.is_protected returns false, but after protection, it returns true.

Console Output

This is the console output of the above sample code for reference.

IsProtected - Before Protecting VBA Project: False

IsProtected - After Protecting VBA Project: True