When I create an Excel Sheet with PHPEXCEL based on the "01simple-download-xlsx.php" example, I will get an error message in Excel as I am using UTF-8. The error message says "Excel cannot open the file because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file." I've used the 01simple-download-xlsx.php Testfile and tried to change the $objWriter to the one out of the 26utf8.php Testfile... both didnt work...
So how can I prevent this error and create a prope开发者_开发百科r UTF-8 compatible Excel file with PHPEXCEL?
The reason was: I have saved my php files with notepad in UTF-8 format. Therefor it was saved with the UTF-8 BOM. I have reopened the files in Notepad++ and saved the files as UTF-8 Without BOM. This way the Excel file gets generated correctly.
精彩评论