Protection problem in XLS

Topics: Developer Forum, User Forum
Mar 23, 2010 at 3:12 PM
Edited Mar 23, 2010 at 3:15 PM
Hello, i try to load a XLS Template file (protectionProblem_template.xls) and copy it to protectionProblem_copy_from_template.xls.
Here the code:

$objReader = @PHPExcel_IOFactory::createReader('Excel5');
$objPHPExcel = @$objReader->load("protectionProblem_template.xls");
$objWriter = @PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');

$tempfile = "protectionProblem_copy_from_template.xls.";

try
{
@$objWriter->save($tempfile);
}
catch(Exception $exc)
{
die();
}


the template.xls has two sheets (both the same) where some fields are protected and some not.

For example: Protected: D20, unprotected: D21

After creating the copy from the template the first sheet is completly protected.

I have uploaded both files:
http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=10749

Where is the problem?

Thank you,
Florian
Mar 25, 2010 at 8:04 AM
Any ideas?
Developer
Mar 26, 2010 at 4:25 AM

Created work item:

http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=12288

Please try with latest source code tomorrow from here and report back if it works.

http://phpexcel.codeplex.com/SourceControl/list/changesets

Mar 29, 2010 at 8:39 AM

Yes it works!

Thank you for your great support!

 

I have another 2 (little) problems on a different worksheet, but i will post them later.

 

Thank you again!

 

Best,

Florian