Exporting Excel file from ASP returns "different file format than extension error

sumon

New Member
I have read a lot about this subject ( http://stackoverflow.com/questions/...sults-in-different-file-format-than-extension) 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\[code\] <% 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 %>\[/code\]Thanks in advance.
 
Back
Top