0

I am using the solution here to try and export a HTML table to an Excel file, and I am able to download the .xls file fine.

However, when I open it in Excel, I am getting the prompt that The file format and extension of {file} don't match. The file could be corrupted or unsafe. Unless you trust it's source, don't open it. Do you want to open it anyway?

If I click "Yes", the file opens and displays as it should. If I try to "Save" it again, Excel seems to think it is a webpage and gives it a .htm or .html file ending.

How can I use Javascript to make sure that the file is saved in the correct xls file format?

0 Answers0