I have read a lot about this subject ( Excel spreadsheet generation results in "different file format than extension error" when opening in excel 2007 and http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/03/11/excel-2007-extension-warning.aspx) and from my understanding, there is not a server-side solution to this problem. The thing is the majority of the posts regarding this subject all have more than 2 years now.
Has there been any development regarding the export of .xls and .xlsx files from a web page? Is the only solution to use another format like .csv?
This is the code I currently have, and aside the Excel message, it works without any problem
<%
Dim objExXML
Dim objExXSL
set objExXML = Server.CreateObject("Microsoft.XMLDOM")
objExXML.async = false
objExXML.loadxml(session("variable"))
set objExXSL = Server.CreateObject("Microsoft.XMLDOM")
objExXSL.async = false
objExXSL.load(Server.MapPath("file_test.xsl"))
Dim excelStr
excelStr = objExXML.transformNode(objExXSL)
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "Attachment; filename=file.xlsx"
Response.Write excelStr
%>
Thanks in advance.