I've done some pretty deep searching on this issue with no luck. It seems that in the past couple of days the output to XLS from HTML has stopped working on many legacy (read: Classic ASP) systems I support. I've been able reproduce this on multiple servers, multiple independent source code from Office 2010 through Office 2016. I've looked at everything I can think of without success so I'm curious to know if there is something I might be overlooking. I'm starting to think this may be a bad Office update that is the culprit.
Sample of what works and has been working for many years:
<%
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;filename=TestExcel.xls"
%>
<html>
<body>
<table>
<thead>
<tr>
<th>column 1 header</th>
<th>column 2 header</th>
</tr>
</thead>
<tbody>
<tr>
<td>column 1 value</td>
<td>column 2 value</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Footer 1</td>
<td>Footer 2</td>
</tr>
</tfoot>
</table>
</body>
</html>
What is curious is that the XLS file is in fact created but when it is opened Excel opens but not file is present.
Even more curious is that when you open the XLS file with some text editor (notepad for example) and just File->Save As it opens without issue.
The issue is related to Microsoft Security Update KB3115262 for Excel that was released July 12, 2016. The security update information can be found in Microsoft Security Bulletin MS16-088 - Critical.
I've found three workarounds (in my order of preference):
Below are several links regarding the issue for further perusal. https://social.technet.microsoft.com/Forums/en-US/d2d84793-9920-45e3-baef-5027a4ac1ae0/kb3170008-for-office-2016-breaks-functionality-ms16088?forum=officeitpro
https://technet.microsoft.com/library/security/MS16-088
https://salesforce.stackexchange.com/questions/131404/end-user-cannot-open-a-xls-report-exported-from-salesforce
Export HTML Table to Excel- Doesn't Open in Office 2010
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With