We have a working PHP code snippets for ages. We are generates simple HTML tables and than the user can save these as an XLS file. And open it in Excel.
Now when we open this kind of files Excel opens and display a totaly empty grey area. No error, no message. Just a blank space. It is only occures on machines where the Office 2010 got the last (2016.07.14) official Microsoft Office updates!
The above mentioned PHP snippet is very easy:
header("Content-Type: application/vnd.ms-excel");
header("Content-Transfer-Encoding: binary");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Content-Disposition: attachment; filename=CO3_finance_export.xls");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
echo chr(255).chr(254).iconv("UTF-8", "UTF-16LE//IGNORE", $out);
BOM is there, and $out contains the table. If you put any simple table in the $out - it is not woking. For example:
<table><tr><td>XX</td></tr></table>
It is very strange since if I open the generated file in Notepad++ and save it again (nothing changed), than Excel will open it correctly.
I think the problem is somewhere with iconv... since I remove it Excel display some weird characters.
Are there somebody in the same situation?
I would appreciate any help or suggestion about my problem.