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

后端 未结 12 1549
无人共我
无人共我 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 error code 0x800A03EC (or -2146827284) means NAME_NOT_FOUND; in other words, you've asked for something, and Excel can't find it.

    This is a generic code, which can apply to lots of things it can't find e.g. using properties which aren't valid at that time like PivotItem.SourceNameStandard throws this when a PivotItem doesn't have a filter applied. Worksheets["BLAHBLAH"] throws this, when the sheet doesn't exist etc. In general, you are asking for something with a specific name and it doesn't exist. As for why, that will taking some digging on your part.

    Check your sheet definitely does have the Range you are asking for, or that the .CellName is definitely giving back the name of the range you are asking for.

提交回复
热议问题