I'm writing a Visualforce page which downloads an Excel file onto the user's computer. I have done this by adding the following to the
contentType="application/vnd.ms-excel#My File Name.xls" cache="true"
This successfully downloads a file which opens in Excel, however I get the error that the file format and extension don't match. This is because I am actually opening a Web Page in Excel. When I go to save it, I have to change the file type from Web Page to Excel Workbook.
Is there any way to automatically download the page as an Excel Workbook to avoid these two issues?