Prevent PHPExcel to calculate values when writing to file

*爱你&永不变心* 提交于 2019-12-01 17:19:19

The PHPExcel calculation engine is called by default when you save, but you can tell the writer not to apply it by calling

$objWriter->setPreCalculateFormulas(false);

before the call to save


When you set a cell value with a call to setCellValue() or similar, PHPExcel will attempt to identify the datatype and set it appropriately internally (in exactly the same way as MS Excel) using the value binder. Cells that contain a = as the first character will be considered as formulae by this.

If you want to ensure that they are treated as strings instead of formulae, then the easiest approach is to use setCellValueExplicit() instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!