Exception HResult 0x800a03ec when trying to open Excel with Microsoft.Office.Interop.Excel.Workbooks.Open()

前端 未结 3 1270
轻奢々
轻奢々 2021-01-06 01:44

Following Exception is thrown if I try to open an excel file on a client machine:

Exception from HRESULT: 0x800A03EC

Inner Exceptions: (emp

3条回答
  •  不要未来只要你来
    2021-01-06 02:10

    Sorry - I know this is an indirect answer, although I would recommend you follow on. I personally have very bad experiences with Excel Interop services (ASP.NET application). As I am aware Microsoft does not recommend Interop server automation.

    Even if you solve this issue you might stumble into issues with memory leakage, performance etc. In my previous project we were advanced with Excel interop automation until deployment. We stumbled into so many issues (Excel Interop processes not closing properly etc.) that we had to rewrite everything to OpenXML.

    If possible use the new OpenXML format. There is a ClosedXML library that makes working with very easy.

    Why OpenXML vs Interop?:

    1. Efficiency (OpenXML is lightweight)

    2. No memory leakage risk

    3. Ease of use

提交回复
热议问题