The attached version of the DLL didn’t seem to change anything. After running some test scenarios, I’ve found that it’s the p.IsEditingContentsAllowed = false; setting that is causing the freeze panes and filter options to be disabled in the worksheet.
Just to be clear on my process:
- I am generating a new .xlsx workbook from scratch with some random data.
- All cells are set to locked.
- There are NO freeze panes or filters dynamically added to the generated worksheet.
- I am protecting the worksheet with the settings provided in the original post.
- I have generated the file under all of these conditions:
- With a license file / without a license file
- I used both the 188.8.131.52 and the 184.108.40.206 dlls.
In all cases, after generation, the freeze panes and filter options in the Excel ribbon are disabled when IsEditingContentsAllowed is set to false.
I can’t speak to what’s actually happening under the hood, but it seems this is a bug. The description of this property states:
"Represents if the user is allowed to edit contents of locked cells on a protected worksheet."
I take this to mean that only the contents of cells cannot be modified. But in fact this setting also disables the freeze panes option in the View tab and the filter option in the Data tab.
Is it the intent of the property to disable freeze panes and filters as well as lock cell contents?