Excel error HRESULT: 0x800A03EC while trying to get range with cell's name

后端 未结 12 1537
无人共我
无人共我 2020-11-30 12:30

I am working with Window Service project. that have to write data to a sheet in Excel file in a sequence times.

But sometimes, just sometimes, the service throw out

12条回答
  •  爱一瞬间的悲伤
    2020-11-30 12:53

    The meaning of the completely undocumented error 800A03EC (shame on Microsoft!) is something like "OPERATION NOT SUPPORTED".

    It may happen

    • when you open a document that has a content created by a newer Excel version, which your current Excel version does not understand.
    • when you save a document to the same path where you have loaded it from (file is already open and locked)

    But mostly you will see this error due to severe bugs in Excel.

    • For example Microsoft.Office.Interop.Excel.Picture has a property "Enabled". When you call it you should receive a bool value. But instead you get an error 800A03EC. This is a bug.
    • And there is a very fat bug in Exel 2013 and 2016: When you automate an Excel process and set Application.Visible=true and Application.WindowState = XlWindowState.xlMinimized then you will get hundreds of 800A03EC errors from different functions (like Range.Merge(), CheckBox.Text, Shape.TopLeftCell, Shape.Locked and many more). This bug does not exist in Excel 2007 and 2010.

提交回复
热议问题