Can't read simple XLS 2003 file

Topics: Developer Forum, User Forum
Aug 21, 2009 at 7:10 AM

Hello!

 

We have successfully generated a 2003 Excel file with PHPExcel. This file can be read by PHPExcel. However, if the file is opened and saved in Excel (2003 or 2007), it can't be read.

Message returned : Exception: Unrecognized token 6C in formula in /gaps/web/wwwroot/noirs/include/codeplex/PHPExcel/Reader/Excel5.php on line 4295

file exported (loading works) : http://www.2shared.com/file/7292896/322c459c/2003FromPHPExcel.html

file after save in Excel 2003 : http://www.2shared.com/file/7292842/80efffc8/2003in2003.html

Sample load code :

 

 ini_set('memory_limit','200M');
    $objReader =
      PHPExcel_IOFactory::createReaderForFile($fileProperties['tmp_name']);
    $objReader->setReadDataOnly(true);
    $objPHPExcel = $objReader->load($fileProperties['tmp_name']);
    $objPHPExcel->setActiveSheetIndex(0);
    $sheet = $objPHPExcel->getActiveSheet();
ini_set('memory_limit','200M');
$objReader =PHPExcel_IOFactory::createReaderForFile($fileProperties['tmp_name']);
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($fileProperties['tmp_name']);

$objPHPExcel->setActiveSheetIndex(0);
$sheet = $objPHPExcel->getActiveSheet();

Import export using same code and same data works well with Excel 2007 file format.

Kind regards from Switzerland!

 

 

Developer
Aug 21, 2009 at 7:41 AM

Fixed in work item 10494:

http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=10494

Aug 21, 2009 at 7:57 AM

Thanks for the quick fix!

We applied the patch and now it works perfectly!