We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Password protect the VBA project


Is there a way to password protect the VBA project in a workbook? I haven’t found anything in VbaModule and VbaProject classes that could help with this.

Thanks & regards,


Thanks for your posting and using Aspose.Cells.

We are afraid, this is a new feature and currently not available. Therefore, we have logged a New Feature request in our database for investigation. We will look into it and implement it if possible. Once the feature is available or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-44219 - Password protect the VBA project

That’s great! We’re looking forward to it.

Thanks & Regards,

Thanks for using Aspose.Cells.

This is to inform you that we have fixed your issue CELLSNET-44219 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Thanks for using Aspose.Cells.

Please download and try the following latest fix

Aspose.Cells for .NET v17.03.1 (.NET 2.0) compiled in .NET Framework 2.0.
Aspose.Cells for .NET v17.03.1 (.NET 4.0) compiled in .NET Framework 4.0.

and let us know your feedback.
Here is a sample code for your reference.

Workbook wb = new Workbook("inFile.xlsm");
Aspose.Cells.Vba.VbaProject vbaProject = wb.VbaProject;
//Whether "Lock project for viewing" or not
Console.WriteLine("isProtectView: " + vbaProject.IslockedForViewing);
//Lock project for viewing
vbaProject.Protect(true, "your password");

The issues you have found earlier (filed as CELLSNET-44219) have been fixed in Aspose.Cells for .NET 17.4.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.