Why showing error message while opening .xls file

前端 未结 6 1466
自闭症患者
自闭症患者 2020-12-30 09:14

In my asp.net, C# application we are generating and downloading .xls file. But when I\'m trying to open, it\'s giving a message

\"The file you are try

6条回答
  •  旧巷少年郎
    2020-12-30 09:59

    This one might be an old post, but I've been searching answers for the same issue, and thought it could be useful. It looks it's not related to the way your application gives the xls file to the browser. It's an issue with Office 2007 excess of security.

    Microsoft's KB article 948615 explains it:

    When you open a file in Excel 2007, you receive a warning that the file format differs from the format that the file name extension specifies.

    The only solution is to add en entry to the client's registry. I know that's not a real solution for a web application maybe with hundreds of users, but at least you can add a note to the page telling how to fix that annoying warning.

提交回复
热议问题