PHPExcel protect chart from drag and drop, and cut

2019-06-01 01:59发布

I used PHPExcel to generate chart and i done it, also i have protected (read only) the file. But now i want to avoid from dragging of chart and also the cut option should be disabled or user should not be able to cut the chart. For any help thanks.

1条回答
Ridiculous、
2楼-- · 2019-06-01 02:20

This code protects all objects in workbook - including charts:

$workbook->getActiveSheet()->getProtection()->setObjects(true);

Tested on PHPExcel 1.8.0.

查看更多
登录 后发表回答