PHPExcel icon indicating copy to clipboard operation
PHPExcel copied to clipboard

Protect inserted images.

Open egmen opened this issue 12 years ago • 2 comments

I paste an image into worksheet by: $objDrawing = new PHPExcel_Worksheet_Drawing();

Then I put a protection to worksheet: $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); $objPHPExcel->getActiveSheet()->getProtection()->setFormatColumns(true);

But I still able to move this image from place to place by Excel. If I disable protection in Excel and then enable it again with the same rules, I can't move an image anywhere.

egmen avatar Feb 04 '14 09:02 egmen

I make an investigation of generated and saved by excel files and I've found 2 differences between them. xl\worksheets\sheet1.xml Well working file has 2 additional values in tag. They are objects="1" scenarios="1". Value objects="1" is an important for fixing this bug. Could somebody make an patch for this bug?

egmen avatar Feb 04 '14 09:02 egmen

I've found a decision. $objPHPExcel->getActiveSheet()->getProtection()->setObjects(true); Thanks

egmen avatar Feb 04 '14 10:02 egmen