Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 14, 2012 07:01 AM by Dalong Zhang - MSFT
Nov 12, 2012 02:02 PM|LINK
Currently all our excel sheets are being generated in Excel (1997-2003) format which is of extension .xls. These types of excel will have a problem when user have higher version of office installed. (Due to Extension Hardening Feature : A warning messages
will be dispalyed before opening the excel sheet). As per our requirment we need to generate excel sheets in .xlsx format.
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
I have used the correct MIME type for Excel 2007/2010 as mentioned above.
Excel file which is being generated from web site is opening in .xlsx type but i am getting below error message :
Excel cannot open the file .xlsx because the file format or file extension is not valid.Please make sure that fiel is not corrupted.
But when I tried to save the same file in .xls format, it is opening fine without any issues.
My web site is hosted in IIS 7, so b ydefault all MIME types are already added.
Can any one please help me in resolving the issue.
Nov 14, 2012 07:01 AM|LINK
We can change any file extension to .xlsx or anything we want. OS automatically will change the icon for the file to the related program icon, so we see on surface is an xlsx file with Excel icon , but actually , the file itself is not an xlsx file.