Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

PHPExcel_Writer_Excel2007 - Uncaught exception 'PHPExcel_Exception' with message 'Invalid cell coordinate' apparently linked to Workbook name #1282

Open
BlackPage05 opened this issue Aug 11, 2017 · 1 comment

Comments

@BlackPage05
Copy link

BlackPage05 commented Aug 11, 2017

Hi there,

I'm encountering a problem I cannot seem to be able to resolve upon trying to save a xlsx file based on the attached xlsx source

Here is the stack trace of the error

Fatal error: Uncaught exception 'PHPExcel_Exception' with message 'Invalid cell coordinate 'EAF-CLAN'' in /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Cell.php:590
Stack trace:
#0 /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Cell.php(643): PHPExcel_Cell::coordinateFromString(''EAF-CLAN'')
#1 /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Cell.php(618): PHPExcel_Cell::absoluteCoordinate(''EAF-CLAN'')
#2 /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Writer/Excel2007/Workbook.php(331): PHPExcel_Cell::absoluteReference(''EAF-CLAN'')
#3 /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Writer/Excel2007/Workbook.php(308): PHPExcel_Writer_Excel2007_Workbook->_writeDefinedNameForNamedRange(Object(PHPExcel_Shared_XMLWriter), Object(PHPExcel_NamedRange))
#4 /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Writer/Excel2007/Workbook.php(277): PHPExcel_Writer_Excel2007_Workbook->_writeNamedRanges(Object(PHPExcel_Shared_XMLWriter), Object(PHPExcel))
#5 /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Writer/Excel2007/Workbook.php( in /var/www/html/inc/lib/phpexcel/classes/PHPExcel/Cell.php on line 590

And here is the xlsx source file

bc_fibre_sfr.xlsx

What the required php code does is :

Open the source file
Update values in certain cells
Save the result as a new xlsx file

The problem is located when trying to save the result file :

$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
print "go"; 
$objWriter->save($C->path() . $Final_File); print "done";

Go is displayed, done is never reached

I've been trying to find the error for weeks but can't seem to grasp it...

Notice that just opening the xlsx file and then trying to save it has the same problem, thus it is not linked to the values that are updated.

Thx in advance

@BlackPage05 BlackPage05 changed the title Uncaught exception 'PHPExcel_Exception' with message 'Invalid cell coordinate' apparently linked to Workbook name PHPExcel_Writer_Excel2007 - Uncaught exception 'PHPExcel_Exception' with message 'Invalid cell coordinate' apparently linked to Workbook name Aug 11, 2017
@PowerKiKi
Copy link
Member

thus it is not linked to the values that are updated

Then it is linked to the file itself. Try to modify the file, for instance by deleting columns/rows, until it works to identify exactly what cell and what cell content is the problem.

Also next time, please take care of formatting your message. Either use the toolbar or ``` syntax to format code blocks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants