Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

To Export to Excel we use

1)for Excel 2003
Response.ContentType = "application/vnd.ms-excel";

what is Response.ContentType for Excel 2007.
Posted

The content type for .xlsx files is;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
 
Share this answer
 
response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
response.AppendHeader("content-disposition";, "attachment;filename=Product_Report.xls";);



I was suffered with same problem...and found the above solution.
You should try it
 
Share this answer
 
Comments
CHill60 25-Jun-13 7:27am    
Quote - "You should try it" ... I suspect he did as the question is over 3 years old and Rod Kemp provided the answer in Solution 2 above

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900