Generation of Excel in classic asp generating blank worksheet

1

I have a testexcel.asp file that for excel generation:

<%@ Language=VBScript %>
<% 
Response.AddHeader "Content-Disposition", "attachment; filename=excelTest.xls"
Response.ContentType = "application/vnd.ms-excel"
%>
<table>
    <tr>
        <td>Test</td>
    </tr>
</table>

Only when opening in excel the file goes blank. If I open it in notepad ++ save without changing anything and try to open in excel again it opens normally. Follow the test link 104.41.63.35/testeexcel.asp

I tried configuring the file but it did not work at all. Any tips?

Environment: Windows Server 2012 with IIS 8

    
asked by anonymous 26.07.2016 / 23:02

1 answer

1

I discovered the cause of the problem and the solution. Recently, some security updates have been installed that block the display of generated excel spreadsheets sent over the internet.

  • Windows Update KB3115262 (Excel 2013)
  • Windows Update KB3115130 (Excel 2010)

In order to view generated worksheets there are three options:

  • Uninstall updates (not recommended)
  • Configure Excel to open files from the internet (recommended)

    • Open Excel
    • From the File menu, select Options
    • Click Reliability Center ... on the left tab
    • Click the Trust Center Settings button on the right tab
    • Click Protected View
    • Uncheck the box Enable Protected View for files originating from the Internet
  • Unlock the file
    • Download the file
    • Instead of opening directly, view the file in the
    • Right click on the file
    • Select Properties
    • Select the Unblock
    • Click OK or Apply
  • 27.07.2016 / 13:50