You need to sign in to do that
Don't have an account?
Excel cannnot open the file 'somefile.xlsx' because the file format or file extension is not valid..
Hi Everyone,
I want to develop MS Excel download feature for some of my data, thus I created a VF page with following attribute on the apex:page tag.
"Excel cannnot open the file 'somefile.xlsx' because the file format or file extension is not valid. Verify that file has not been corrupted and that the file extension matches the format of the file."
I think issue is with its given MIME type or file extension since i can see data, its not corrupted. Could anybody help me make this download without that warning message ?
I want to develop MS Excel download feature for some of my data, thus I created a VF page with following attribute on the apex:page tag.
contentType="application/vnd.ms-excel#somefile.xls"With this I get the file downloaded but when I try to open it, the Excel application (I use 2013 version) shows a warning message before showing the data.
"Excel cannnot open the file 'somefile.xlsx' because the file format or file extension is not valid. Verify that file has not been corrupted and that the file extension matches the format of the file."
I think issue is with its given MIME type or file extension since i can see data, its not corrupted. Could anybody help me make this download without that warning message ?

Try adding cache="true"
Sadly cache="true" doesnt help. Thank you for your reply.