1. 程式人生 > >PHPExcel的exception 'Exception' with message 'The filename is not recognised as an OLE file問題解決...

PHPExcel的exception 'Exception' with message 'The filename is not recognised as an OLE file問題解決...

[ 錯誤資訊 ]

exception 'Exception' with message 'The filename ../../Uploads/taobaoExcel/day_110815/201108151844517294.xls is not recognised as an OLE file' in E:\phpworks\apache\htdocs...

問題原因:


雖然該檔案可能有一個xls副檔名,這是一個“假”的Excel檔案。如果您在文字編輯器開啟該檔案你會發現它實際上是一個HTML檔案。
我的原因是模版有錯,我直接把Excel2007的字尾,xlsx改成xls,導致“偽”xls檔案

解決辦法:


使用Excel2007建立後,另存為2003的