Why showing error message while opening .xls file

前端 未结 6 1371
自闭症患者
自闭症患者 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:56

    Not sure how you are exporting data to excel. Setting the DisplayAlerts to false might help.

    xlApp = new Excel.Application();
    xlApp.DisplayAlerts = false;
    

    I use interop DLL. The namespace would be Microsoft.Office.Interop.Excel. See Feng Chen's answer in the following link on how to add the reference: http://social.msdn.microsoft.com/Forums/en/netfxsetup/thread/c9e83756-4ae2-4ed4-b154-1537f3bb3a22

    The following link might also help:

    http://www.dotnetperls.com/excel

提交回复
热议问题