You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [>] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
There should be a function which can lock a particular cell in a sheet
What is the current behavior?
//This is my code -->
where I am trying to first lock the whole sheet
2.Unlocking and only locking the needed cell
But all it does lock whole sheet thats it
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet->getActiveSheet()->getProtection()->setSheet(true);
$spreadsheet->getDefaultStyle()->getProtection()->setLocked(false);
$spreadsheet->getActiveSheet()->getStyle('A1')->getProtection()->setLocked(
\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED
);
<?phprequire__DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object//This is my code --> 1. where I am trying to first lock the whole sheet 2.Unlocking and only locking the needed cell
3.But all it does lock whole sheet thats it
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet->getActiveSheet()->getProtection()->setSheet(true);
$spreadsheet->getDefaultStyle()->getProtection()->setLocked(false);
$spreadsheet->getActiveSheet()->getStyle('A1')->getProtection()->setLocked(
\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED
);
// add code that show the issue here...
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Reader
Writer
Styles
Data Validations
Formula Calculations
Charts
AutoFilter
Form Elements
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Which versions of PhpSpreadsheet and PHP are affected?
almost the lastest
The text was updated successfully, but these errors were encountered:
Unable to duplicate, or I don't understand the problem you're reporting. I run your code, and save the spreadsheet. When I open it in Excel, I can change the value of every cell on the sheet except for A1. When I try to change A1, I get a message that the sheet needs to be unprotected first. Is that not what you intended? Do you see something different? If so, please let me know PhpSpreadsheet version, Php version, and your environment (e.g. Windows command line). You might also want to upload the file which is not working correctly.
I ran into the exact same issue, I almost pulled my hair out.
I'm on Linux so I use LibreOffice. LibreOffice just freezes the whole sheet, but Excel Online has the desired behavior. I would think this is a LibreOffice bug.
This is:
What is the expected behavior?
There should be a function which can lock a particular cell in a sheet
What is the current behavior?
//This is my code -->
2.Unlocking and only locking the needed cell
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet->getActiveSheet()->getProtection()->setSheet(true);
$spreadsheet->getDefaultStyle()->getProtection()->setLocked(false);
$spreadsheet->getActiveSheet()->getStyle('A1')->getProtection()->setLocked(
\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED
);
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Which versions of PhpSpreadsheet and PHP are affected?
almost the lastest
The text was updated successfully, but these errors were encountered: