I am building a C# web application using ASP.NET Core (.NET Framework 7.0.103) and FreeSpire.XLS version 12.7.0
In my application, I am creating an export page where users will be able to export various data into an excel spreadsheet. In some cases, I want to make the sheet protected or read only where the user will not be able to make any changes to the downloaded workbook. I understand that I would have to apply the protection to each sheet so currently this is my code:
Spire.Xls.Workbook workbook = new();
// code that builds worksheets goes here
// at the end of the build, make all the sheets protected
foreach(var sheet in workbook.Worksheets)
{
sheet.Protect("test", SheetProtectionType.All);
}
I thought this would work according to the documentation, but I'm not seeing the downloaded workbook being protected. Is this feature exclusive only to the paid version of Spire.Xls? If not, am I doing something wrong here?