Hi,
I am pretty sure that is not possible to use Aspose.Cells to set the “Lock project for viewing” in the VBA-editor (Tools->VBAProject Properties->Protection).
May I add a feature request: Make it at least possible to check if this has been set.
It is absolutely crucial that our developers turn on the “Lock project for viewing” when designing the Excel templates, but sometimes they forget. If we at least can check if the flag is set, our code can prevent showing the Excel document to a user.
Thanks,
Fredrik
Hi,
We are pleased to inform you that we have fixed your issue logged earlier as “CELLSNET-45216”. We will soon provide you the fix after performing QA and incorporating other enhancements and fixes.
Thank you.
Hi,
Thanks for using Aspose.Cells.
Please download and try the following latest fix
and let us know your feedback.
Here is a sample code for your reference.
C#
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");
wb.Save("outFile.xlsm");
The issues you have found earlier (filed as CELLSNET-45216) have been fixed in Aspose.Cells for .NET 17.4.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.