Title: Export Critical error with XLS PHP setCellValueExplicit
Last modified: February 27, 2025

---

# Export Critical error with XLS PHP setCellValueExplicit

 *  Resolved [maroxis](https://wordpress.org/support/users/maroxis/)
 * (@maroxis)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/export-critical-error-with-xls-php-setcellvalueexplicit/)
 * I’ve made some formulas using ‘Custom php to modify output’
   In add_action( ‘woe_xls_print_footer’,
   function ($objXls,$formatter) {}I’ve used $sheet->setCellValue( “G”. ($row+2),“
   =SUMIF(L4:L$row;23;G4:G$row)”);But in exported excel sheet it appeared as Error508
   until user manually edited formula (adding space and removing worked)According
   to docs [https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#write-a-formula-into-a-cell](https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#write-a-formula-into-a-cell)
   I’m supposed to use setCellValueExplicit but using:$sheet->setCellValueExplicit(“
   G”. ($row+1), “=SUM(G4:G$row)”, \PhpOffice\PhpSpreadsheet\Cell\_DataType_::TYPE_STRING);
   throws error:PHP Fatal error:  Uncaught Error: Class “PhpOffice\PhpSpreadsheet\
   Cell\DataType” not found in […]/wp-content/plugins/woo-order-export-lite/classes/
   core/class-wc-order-export-engine.php(370) : eval()’d code:49

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Support [aprokaev](https://wordpress.org/support/users/aprokaev/)
 * (@aprokaev)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/export-critical-error-with-xls-php-setcellvalueexplicit/#post-18333221)
 * hello
 * We use PHPExcel, so replace
 * \PhpOffice\PhpSpreadsheet\Cell\_DataType_::TYPE_STRING);
 * with
 * PHPExcel_Cell_DataType::TYPE_STRING
 *  Thread Starter [maroxis](https://wordpress.org/support/users/maroxis/)
 * (@maroxis)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/export-critical-error-with-xls-php-setcellvalueexplicit/#post-18344261)
 * Changing it to PHPExcel_Cell_DataType::TYPE_FORMULA fixed PHP error, but I still
   got formulas showing as Error 508, doesn’t matter if I use setCellValueExplicit
   or setCellValue
 *  Plugin Support [aprokaev](https://wordpress.org/support/users/aprokaev/)
 * (@aprokaev)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/export-critical-error-with-xls-php-setcellvalueexplicit/#post-18344291)
 * please, submit your settings as new ticket to [https://algolplus.freshdesk.com/](https://algolplus.freshdesk.com/)
 * use tab Tools to get them.
 * but I will reply only tomorrow , it’s late here
 *  Thread Starter [maroxis](https://wordpress.org/support/users/maroxis/)
 * (@maroxis)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/export-critical-error-with-xls-php-setcellvalueexplicit/#post-18356016)
 * Thanks,
   It seems that I had to replace ; with , in formula. Probably language
   formula conversion error. There is another problem that it sometimes shows 0 
   instead of calculated value, but it looks like libre office specific problem.
 *  Plugin Support [aprokaev](https://wordpress.org/support/users/aprokaev/)
 * (@aprokaev)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/export-critical-error-with-xls-php-setcellvalueexplicit/#post-18356278)
 * You’re welcome

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Export Critical error with XLS PHP setCellValueExplicit’ is closed to
new replies.

 * ![](https://ps.w.org/woo-order-export-lite/assets/icon-256x256.png?rev=1365554)
 * [Advanced Order Export For WooCommerce](https://wordpress.org/plugins/woo-order-export-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-order-export-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-order-export-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-order-export-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-order-export-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-order-export-lite/reviews/)

## Tags

 * [formula](https://wordpress.org/support/topic-tag/formula/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [xls](https://wordpress.org/support/topic-tag/xls/)

 * 5 replies
 * 2 participants
 * Last reply from: [aprokaev](https://wordpress.org/support/users/aprokaev/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/export-critical-error-with-xls-php-setcellvalueexplicit/#post-18356278)
 * Status: resolved