Im trying to make a parsing program that is compatible with both Excel 5.0 files and Excel 2007 files.
So far i've been having no problems with the Excel2007 it works like a charm but, when I tried to load a Excel 5.0 file i got the following errors:
Notice: Undefined offset: 0 in /xxx/xxx/xxx/xxx/xxx/PHPExcel/Reader/Excel5.php on line
Fatal error: Argument 1 passed to PHPExcel_Style::setFont() must not be null, called in /xxx/xxx/xxx/xxx/xxx/PHPExcel/Reader/Excel5.php on line 1338 and defined in
/xxx/xxx/xxx/xxx/xxx/PHPExcel/Style.php on line 563
This are my include paths:
And this is the script:
$objReader = PHPExcel_IOFactory::createReader('Excel5');
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
echo('Invalid file format');
$objPHPExcel = $objReader->load($filepath);
$val = ($objPHPExcel->getActiveSheet()->getCell('A1'));
$temp = $val->getvalue();
Basically what im doing here is ask for the MIME type of the file and depending on that I'll create the corresponding reader.
Like I said before it works with Excel 2007 but not with Excel 5.0
Any help would be appreciated.