Password Protect the VBA Project of an Excel Workbook

Password Protect the VBA Project of an Excel Workbook in Python

You can password‑protect the VBA (Visual Basic for Applications) project of a workbook with Aspose.Cells for Python via .NET using the VbaProject.protect() method.

Sample Code

The following sample code loads the sample Excel file, accesses its VBA project, and protects it with a password. Finally, it saves it as the output Excel file.