I believe i have found a bug when adding advanced protection to a worksheet. If it isn't a bug id be interested in the explanation.
oWorksheet.Protection.IsDeletingColumnsAllowed = false;
oWorksheet.Protection.IsDeletingRowsAllowed = false;
//oWorksheet.Protection.IsEditingContentsAllowed = false;
oWorksheet.Protection.IsEditingObjectsAllowed = false;
oWorksheet.Protection.IsEditingScenariosAllowed = false;
oWorksheet.Protection.IsFilteringAllowed = false;
oWorksheet.Protection.IsFormattingCellsAllowed = false;
oWorksheet.Protection.IsFormattingColumnsAllowed = false;
oWorksheet.Protection.IsFormattingRowsAllowed = true;
oWorksheet.Protection.IsInsertingColumnsAllowed = false;
oWorksheet.Protection.IsInsertingHyperlinksAllowed = false;
oWorksheet.Protection.IsInsertingRowsAllowed = false;
oWorksheet.Protection.IsSelectingLockedCellsAllowed = true;
oWorksheet.Protection.IsSelectingUnlockedCellsAllowed = true;
oWorksheet.Protection.IsSortingAllowed = false;
oWorksheet.Protection.IsUsingPivotTablesAllowed = false;
oWorksheet.Protection.Password = "007";
I was having trouble figuring out why my protection settings were being set (actually in excel) yet were not taking effect. I copied the example given here:
<A href="https://forum.aspose.com/t/96575</A></P> <P>Which worked fine. I stripped my code down to the bare minimum to match this example and the only difference was the line commented out above. I had omitted that line in my code. Using the example again, i commented out the above line and found the protection does not get "invoked", just like my original problem. I thought maybe the protection requires every parameter to be set to be invoked but it seems omitting other paramaters does not cause any problems.
I look forward to your reply.