Cell protection

Topics: Developer Forum, User Forum
Aug 31, 2007 at 5:27 PM
To apply protection to certain cells on a sheet you usually do:
  • apply an "unlocked" style to the cells you want to be unprotected
  • leave the default locked style on the other cells
  • apply sheet protection, giving a password

To implement this in PHPExcel I am thinking of extending the styles that class PHPExcel_Style supports, to include the unlocked status. Apparently we need to apply a applyProtection="1" attribute to the relevant <xf> tag of styles.xml. The same <xf> tag should also contain an <protection locked="0"/> tag.

After doing this, one would apply sheet protection as is already implemented in PHPExcel.

Do you think this would work? I will try and implement it and then of course offer the code if it can be useful.
Sep 3, 2007 at 10:21 AM
If you feel like implementing this and share the code with us, that would be great. Otherwise, we can make this a work item and implement it for the next release?

You can contact me on maarten at php excel dot net if you want more information.
Sep 3, 2007 at 1:11 PM
Hi Maarten, I have sent you an email.
Sep 3, 2007 at 3:36 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.