Saving Error - Uncaught exception

Mar 5, 2008 at 8:47 AM

I would like to import a new file (an Excel2003 file converted to Excel2007 format), enter data in it and then save the file.
It seems everything is working until the saving. I got this error:

10:32:40 Load from Excel2007 file 10:32:43 Write stuffs in the file 10:32:43 Write to Excel2007 format
Fatal error: Uncaught exception 'Exception' with message 'Cell coordinate can not be zero-length string.' in C:\xampp\htdocs\LMS1\strategicdatabase\Classes\PHPExcel\Cell.php:369 Stack trace: #0 C:\xampp\htdocs\LMS1\strategicdatabase\Classes\PHPExcel\Cell.php(406): PHPExcelCell::coordinateFromString('') #1 C:\xampp\htdocs\LMS1\strategicdatabase\Classes\PHPExcel\Writer\Excel2007\Workbook.php(327): PHPExcelCell::absoluteCoordinate('') #2 C:\xampp\htdocs\LMS1\strategicdatabase\Classes\PHPExcel\Writer\Excel2007\Workbook.php(305): PHPExcelWriterExcel2007Workbook->writeDefinedNameForNamedRange(Object(PHPExcelSharedXMLWriter), Object(PHPExcelNamedRange)) #3 C:\xampp\htdocs\LMS1\strategicdatabase\Classes\PHPExcel\Writer\Excel2007\Workbook.php(275): PHPExcelWriterExcel2007Workbook->writeNamedRanges(Object(PHPExcelSharedXMLWriter), Object(PHPExcel)) #4 C:\xampp\htdocs\LMS1\strategicdatabase\Classes\PHPExcel\Writer\Excel2007\Workbook.php(98): PHPExcelWriterExcel2007Workbook->writeDefinedNames(Object(PHPExcel in C:\xampp\htdocs\LMS1\strategic_database\Classes\PHPExcel\Cell.php on line 369

Do someone know why I get this error?

I try to run the tests files. Actually, the tests files are working fine. I do not get any error with the 07reader.php test!

But the file I want to import is quite complicated.... So maybe it is because of that...

Thanks a lot!

PS: My code is:

/** Include path **/
setincludepath(getincludepath() . PATH_SEPARATOR . '../Classes/');

require 'PHPExcel/Reader/Excel2007.php';
include 'PHPExcel/Writer/Excel2007.php';

if (!file_exists("../files/test7.xlsx")) {
exit("Please run 05featuredemo.php first.\n");

echo date('H:i:s') . " Load from Excel2007 file\n";
$objReader = new PHPExcelReaderExcel2007;
$objPHPExcel = $objReader->load("../files/test7.xlsx");

echo date('H:i:s') . " Write stuffs in the file\n";
$objPHPExcel->getActiveSheet()->setCellValue('E39', '10');

echo date('H:i:s') . " Write to Excel2007 format\n";
$objWriter = new PHPExcelWriterExcel2007($objPHPExcel);

// Echo memory peak usage
echo date('H:i:s') . " Peak memory usage: " . (memorygetpeak_usage(true) / 1024 / 1024) . " MB\r\n";

// Echo done
echo date('H:i:s') . " Done writing files.\r\n";
Mar 5, 2008 at 11:24 AM
Is it possible to send me the XLSX file?
Mar 5, 2008 at 11:37 AM
Edited Mar 5, 2008 at 2:44 PM
Yes, sure! Can you post your email address?

Edit: I found it in a previous thread! :-) I just sent the email with the file. Thanks a lot! ;-)
Mar 6, 2008 at 9:39 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.