I don't want the user allowed to edit objects. The checkmark for "edit objects" should be unchecked.
Here is my code:
using (var workbook = new XLWorkbook(download))
{
foreach (var worksheet in workbook.Worksheets.Skip(4))
{
var protection = worksheet.Protect("password");
protection.SelectLockedCells = false;
protection.SelectUnlockedCells = false;
protection.SetObjects(false);
}
workbook.SaveAs(download, true, true);
download.Position = 0;
}
I've also tried:
protection.Objects = false;
protection.Objects = true;
workbook.SaveAs(download, false);
workbook.SaveAs(download, true);
Any idea? I think this might be a glitch.