HRESULT: 0x800A03EC on Worksheet.range

前端 未结 23 2144
Happy的楠姐
Happy的楠姐 2020-11-22 07:42

I am getting HRESULT: 0x800A03EC on Worksheet.range method. Number of rows are more than 70K. Office 2007.

Code:

Microsoft.Office.Interop.Excel.Range         


        
23条回答
  •  有刺的猬
    2020-11-22 08:25

    This problem occurs if you are using a backwards compatible sheet (a .xls) instead of a .xlsx

    To allow sheets to be opened in pre office 2007 version it can't contain more than 65k rows. You can check the number of rows in your sheet by using ctrl+arrowdown till you hit the bottom. If you try to get a range larger than that number of rows it will create an error

提交回复
热议问题