You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
writer successfully writing file by IFERROR handling the divide by 0 and inserting 0 into cell for the following formula:
"=IFERROR(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-2)/ OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-1),0)"
PHP Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Calculation\Exception: TSM!K14 -> Formula Error: An unexpected error occured in includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Cell.php:288
Stack trace:
#0 includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Worksheet.php(761): PhpOffice\PhpSpreadsheet\Cell->getCalculatedValue() #1 includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php(383): PhpOffice\PhpSpreadsheet\Worksheet->calculateColumnWidths() #2 includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php(81): PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet->writeCols(Object(PhpOffice\PhpSpreadsheet\Shared\XMLWriter), Object(PhpOffice\PhpSpreadsheet\Worksheet)) #3 includes/classes/PhpSpreadsheet/src/PhpSpr in includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Cell.php on line 288
What is the current behavior?
With the production code, crash upon first encounter by writer, with/without $writer->setPreCalculateFormulas(false);
With the test case code produces an XLSX file with errors .
This issue will also happen if you do a divide by 0, period, with static numbers in the formula, even when surrounded by an 'IFERROR' and pre-compute formula's is turned off in the writer.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
This is:
What is the expected behavior?
writer successfully writing file by IFERROR handling the divide by 0 and inserting 0 into cell for the following formula:
"=IFERROR(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-2)/ OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-1),0)"
PHP Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Calculation\Exception: TSM!K14 -> Formula Error: An unexpected error occured in includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Cell.php:288
Stack trace:
#0 includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Worksheet.php(761): PhpOffice\PhpSpreadsheet\Cell->getCalculatedValue()
#1 includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php(383): PhpOffice\PhpSpreadsheet\Worksheet->calculateColumnWidths()
#2 includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php(81): PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet->writeCols(Object(PhpOffice\PhpSpreadsheet\Shared\XMLWriter), Object(PhpOffice\PhpSpreadsheet\Worksheet))
#3 includes/classes/PhpSpreadsheet/src/PhpSpr in includes/classes/PhpSpreadsheet/src/PhpSpreadsheet/Cell.php on line 288
What is the current behavior?
With the production code, crash upon first encounter by writer, with/without $writer->setPreCalculateFormulas(false);
With the test case code produces an XLSX file with errors .
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
$ php --version
PHP 7.0.21 (cli) (built: Jul 6 2017 17:50:00) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v6.0.7, Copyright (c) 2002-2016, by ionCube Ltd.
with Zend OPcache v7.0.21, Copyright (c) 1999-2017, by Zend Technologies
The text was updated successfully, but these errors were encountered: