-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protect Sheet But Allow Sort not working #3951
Comments
Here is my PHP code
|
Enabling sorting on a protected sheet in Excel seems more complicated than it ought to be. See https://www.extendoffice.com/documents/excel/4673-excel-sort-filter-protected-sheet.html. This means that you have to explicitly protect ranges that you want to be able to sort/filter on a protected sheet. PhpSpreadsheet supports protected ranges, except that it assumes they will always have a password (and does not support the name attribute, which I'm not sure is significant). I will treat this issue as a feature request, and start looking into that. |
Fix PHPOffice#3951. When an Excel sheet is protected, even when sorting is explicitly allowed without a password, sorts are permitted only on "protected ranges" within the sheet. PhpSpreadsheet already supports protected ranges, and only minor tinkering is necessary for that (e.g. the protected range can have, but does not require, a password). The more important part of this change is documenting the far-from-intuitive way that Excel handles this. To that end, documentation is updated, and a new sample is added. A new class, `Worksheet\ProtectedRange` is added in place of the string array which had been used. `Worksheet::getProtectedCells` is deprecated in favor of the new `Worksheet::getProtectedCellRanges`.
Hi,
When applying a filter and protecting the sheet, the Sort does not work
The text was updated successfully, but these errors were encountered: