Modify the code to use pure CSV, and then return the file to the browser as a filename ending in .csv and content type text/csv.
I have seen people try to do this before, and it only works with certain specific versions of Office Excel. It does not work on other platforms with other spreadsheet programs or with every version of Excel. Use a standard file format, or at least generate a proper OLE2 Compound Document file that contains XLS data in the manner which Excel expects if you're going to send the file to the browser as that file type.