I am using the following Javascript code to generate an excel on the fly, which converts HTML table to a spreadsheet.
The excel file does not open in Office 2010, sh
You are saving a file with HTML content as *.xls. Excel can open this but will normaly show a warning message:
The file you are trying to open, 'name.ext', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
If that warning not occurs and the file is not opening, then maybe the
DWORD Value ExtensionHardening in HKEY_CURRENT_USER\Software\Microsoft\Office\ is set to 2 in Windows Registry
That means "Check the file name extension and the file type. If they do not match, do not open the file."
See https://support.microsoft.com/en-us/kb/948615.
Maybe your administrator has set this via Group Policy setting. If you are in an administrated network, ask your administrator.
If you are administrator of your own, then look for that registry setting and change it to 1, the default.