Reading xlsx file fail :

Topics: Developer Forum, User Forum
Dec 17, 2013 at 3:53 PM

The filename ****.xlsx is not recognised as an OLE file

I readed some subject on this problem but without find solutions. I try to create an xlsx file, to save a .xls has a .xlsx but i have still the same error.

PHPExcel don't support xlsx ?

Dec 18, 2013 at 7:07 AM
You have this error if you try to read, with the Excel5 reader, a file that isn't a xls.

To convert a xls to a xlsx :
  • Read the xls : $objPHPExcel = PHPExcel_IOFactory::load('YourFile.xls');
  • Create a xlsx writer : $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
  • Save the file : $objWriter->save('YourFile.xlsx');
Dec 18, 2013 at 9:02 AM
Now i use Excel2007 to read xlsx and your method to convert..

Thank you so much :)