Protect inserted images.
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.
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
I've found a decision. $objPHPExcel->getActiveSheet()->getProtection()->setObjects(true); Thanks