I'm using PHP excel 1.8.0. I have searched everywhere but I don't understand why following error occures and my excel file is corrupted.
Uncaught exception 'PHPExcel_Calculation_Exception' with message 'Worksheet!K2 -> Formula Error: An unexpected error occured'
I have to use ISO 8859-2 encoding
$formula = iconv('ISO-8859-2', 'UTF-8//IGNORE//TRANSLIT', '=IFERROR(IF(OR(C'.$row.'="string1";C'.$row.'="strin2");D'.$row.';" ");" ")');
$objPHPExcel->getActiveSheet()->setCellValue($where, $formula);
I tried setting formula without =
. After that when I open my excel file all formulas are set properly without =
mark. Then if I add it manually to the formula, it works. But with code like you can see it, formulas are broken.
I have Also tried adding =
after I used iconv, but nothing has changed file was still broken. I would be glad if someone could help me with this problem.