I have a web page which links to an Excel 2007 worksheet. It is a .xls file and not .xlsx file. When I click on the link I get the usual dialog box
Assuming you create your spreadsheet object with this syntax:
You would use this to create the download:
Create your spreadsheet object with this syntax:
And use this to create the download:
Thanks to Raymond Camden for the bulk of this (his example was for creating the spreadsheet in the older format -- I updated for the newer format and use slightly different MIME values).