Bug - $objWriter->save("$file"); - PHPExcel_Writer_Excel2007 - 'Invalid cell coordinate'

Topics: Project Management Forum, User Forum
Jan 19, 2011 at 2:15 PM

Hi All,

@version    1.7.4, 2010-08-26

i got a weird bug:

This procedure works 9 times on 10 but sometimes it crashes and corrupt the xlsx file.

thats the code i used:



$objReader = new PHPExcel_Reader_Excel2007();
echo "<p>step 1-----$cellref
$objPHPExcel = $objReader->load("$file");
echo "<p>step 2";
$pippo = $objPHPExcel->getActiveSheet();
//print_r($pippo );
echo "<p>step 3";
$pippo->setCellValue($cellref, $txttowrite);
echo "<p>step 4";
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
echo "<p>step 5";
echo "<p>step 6";



thats the error i got:

step 1-----ING_IP

step 2

step 3

step 4

step 5
Fatal error: Uncaught exception 'Exception' with message 'Invalid cell coordinate.' in C:\htdocs\Classes\PHPExcel\Cell.php:490 Stack trace: #0 C:\htdocs\Classes\PHPExcel\Cell.php(505): PHPExcel_Cell::coordinateFromString('A') #1 C:\htdocs\Classes\PHPExcel\Writer\Excel2007\Workbook.php(433): PHPExcel_Cell::absoluteCoordinate('A') #2 C:\htdocs\Classes\PHPExcel\Writer\Excel2007\Workbook.php(283): PHPExcel_Writer_Excel2007_Workbook->_writeDefinedNameForPrintArea(Object(PHPExcel_Shared_XMLWriter), Object(PHPExcel_Worksheet), 0) #3 C:\htdocs\Classes\PHPExcel\Writer\Excel2007\Workbook.php(82): PHPExcel_Writer_Excel2007_Workbook->_writeDefinedNames(Object(PHPExcel_Shared_XMLWriter), Object(PHPExcel)) #4 C:\htdocs\Classes\PHPExcel\Writer\Excel2007.php(256): PHPExcel_Writer_Excel2007_Workbook->writeWorkbook(Object(PHPExcel)) #5 C:\htdocs\progs\amstel\amsfunction.php(46): PHPExcel_Writer_Excel2007->save('\\esolver\Prodo...') #6 C:\htdocs\progs\amstel\auth_docnew.php(165): modexcel('\\esolver\Prodo...', 'ING_IP', '19/1/2011 VF', '523 in C:\htdocs\Classes\PHPExcel\Cell.php on line 490

i got the same error even if i try to write the cell "A1"


Jan 19, 2011 at 11:19 PM

From the stack trace, the problem appears to be a print area definition using column references rather than cell references.

Jan 19, 2011 at 11:21 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.