Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))

后端 未结 7 919
有刺的猬
有刺的猬 2020-11-27 21:46

I am trying to convert a .xls file to an .xlsx file on the server-side using Microsoft.Office.Interop.Excel.Workbook class as follows:

 workBook         


        
7条回答
  •  星月不相逢
    2020-11-27 22:05

    You never want to have Excel on your server side!

    And please believe me, if you must manipulate excel sheets, you do not want to use anything else than Excel. Do not use any library, because sooner or later you run into bugs that not get fixed or cannot be fixed for several reasons (one i.e. being, that Excel is doing something "wrong"). You only use Excel on the client side. Your client has to install and maintain it. If it is there, you use it, otherwise you tell them, that Excel functionality is only working with a valid Excel installation on the client computer

    Use XML, a DataSet, or else, to stream Excel information to the server to store it. Or manipulate that data there with your server side code, but not with Excel.

    Excel interop must always happen on the client computer. It's just like that...

提交回复
热议问题