When writing my data in an Excel file with class PHPExcel.
This is happening when the writer works, not when adding data to the cells $this->sheet->setCellValue()
Fatal error: Uncaught exception 'PHPExcel_Calculation_Exception' with message 'Adressen!AF20955 -> Formula Error: Unexpected operator '>'' in \Cell.php:300 Stack trace:
#0 \PHPExcel\Worksheet.php(754): PHPExcel_Cell->getCalculatedValue()
#1 \PHPExcel\Writer\Excel2007\Worksheet.php(373): PHPExcel_Worksheet->calculateColumnWidths()
#2 \PHPExcel\Writer\Excel2007\Worksheet.php(80): PHPExcel_Writer_Excel2007_Worksheet->_writeCols(Object(PHPExcel_Shared_XMLWriter), Object(PHPExcel_Worksheet))
#3 \PHPExcel\Writer\Excel2007.php(304): PHPExcel_Writer_Excel2007_Worksheet->writeWorksheet(Object(PHPExcel_Worksheet), Array, false)
#4 \excel.php(131): PHPExcel_Writer_Excel2007->save('...')
#5 \excel. in \PHPExcel\Cell.php on line 300
I never use the function PHPExcel_Cell->getCalculatedValue()
writing to my Excel but only $this->sheet->setCellValue('A1', $value)
.
I don't need to calculate any formula in my Excel file. Just exporting DB2 data to this file.
It is obviously possible that $value
contains formula characters like = + - > <
(as the cell AF20955
did causing the fatal error with >
) but this should not be interpreted as formula but only as part of string. How can I solve the problem?