File load and save throws exception

Topics: User Forum
Nov 30, 2010 at 5:31 PM

Hi there!

I am doing an effort analysis related to a project we were about to begin at my company. One of the project key features will be some Excel manipulation by code. Just for testing purposes, I tried to load and save an Excel file (2005 version) but during the process are thrown some Exceptions. Here is the script which I am testing:


/** Error reporting */

/** PHPExcel_IOFactory */
require_once '../Classes/PHPExcel/IOFactory.php';

// load the excel document
$objPHPExcel = PHPExcel_IOFactory::load("taeg_prestacoes_fin.xls");

// save the file changes
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));

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

And the Exceptions are the following ones:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Invalid cell coordinate.' in .../php_excel/Classes/PHPExcel/Cell.php:265

Stack trace:

 .../php_excel/Classes/PHPExcel/Writer/Excel5/Worksheet.php(436): PHPExcel_Cell->getCalculatedValue()

.../php_excel/Classes/PHPExcel/Writer/Excel5.php(162): PHPExcel_Writer_Excel5_Worksheet->close()


Help will be appreciated!


Thanks in advance for the help,

Best regards!

Nov 30, 2010 at 9:31 PM

Without a bit more information, it isn't easy to help. Clearly there's something in this file that's throwing PHPExcel, but I can't tell what without doing a full analysis of the file to identify what is triggering this error. Is it possible to upload or email me a copy of the file?