I’m trying to make a table that allows filters on phpspreadsheet.
I can already make the table, and if I remove the protection it will allow me to filter, but as soon as I put the protection, with or without password, it doesnt let me do it
Here is the part of the code for protection
Protection
//Add protection
$protection = $spreadsheet->getActiveSheet()->getProtection();
$protection->setPassword($worksheet_password);
$protection->setSheet(false);
$protection->setSort(false);
$protection->setInsertRows(false);
$protection->setFormatCells(false);
// Add filters to Table
$activeWorksheet->setAutoFilter('C6:P50');
Already put TRUE to all, false to Sheet…
2
Answers
You literaly say don’t allow filter with this line:
I would try with:
In PhpSpreadsheetWorksheetProtection.php it says
I think what you need is
This is working for me