Export HTML Table to Excel- Doesn't Open in Office 2010

后端 未结 8 1620
南方客
南方客 2020-12-08 15:40

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

8条回答
  •  爱一瞬间的悲伤
    2020-12-08 15:54

    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\\Excel\Security 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.

提交回复
热议问题