Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File open in excel version 2013 but not on 2016?

I am sending the html content as excel from my webserver server with the following headers

    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment;filename=test.xls");

I am able to open the file on excel version 2013 but not on 2016. On 2016 version, it says The file is corrupt and can not be opened however once I activate File > Properties > Security> Unblock the file opens up ? Is there any header or other setting where I can specify to unblock security (or other configuration) so that I am able to open the excel file like I do on 2013 ?

like image 858
user3198603 Avatar asked Oct 14 '16 07:10

user3198603


1 Answers

The security settings are set in Excel: not in the workbook. Check File/Options/Trust Centre. You need to compare the settings in both 2013 and 2016. Possibly External Content or File Block settings.

At a guess, 97-2003 workbooks are blocked.

like image 93
cup Avatar answered Nov 13 '22 16:11

cup