Generation of Excel in classic SP generating blank sheet

Asked

Viewed 880 times

1

I have a testeexcel.Asp file 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>

but when opening in excel the file is empty. If I open it in Notepad++ save without changing anything and try to open in excel again it opens normally. Follow the link to test 104.41.63.35/testeexcel.Asp

I tried to configure file encoding but it didn’t work at all. Any hints?

Environment: Windows server 2012 with IIS 8

1 answer

1


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

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

To be able to view generated worksheets there are three options:

  1. Uninstall updates (not recommended)
  2. Configure Excel to open internet files (recommended)

    • Open Excel
    • In the File menu, select Options
    • Click Reliability Center... on the left tab
    • Click the Reliability Center Settings button in the right tab
    • Click Protected View Mode
    • Deselect the Enable Protected View box for files originating from the Internet
  3. Unlock the file
    • Download the file
    • Instead of opening directly, view the file in the folder
    • Right-click on the file
    • Select Properties
    • Select the Unlock box (Unblock)
    • Click OK or Apply

Browser other questions tagged

You are not signed in. Login or sign up in order to post.