HRESULT: 0x800A03EC on Worksheet.range

前端 未结 23 2449
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:10

    EDIT: THIS IS WAY BETTER!!! You don't need that old function, sorry. Just do as follows:

    Microsoft.Office.Interop.Excel.Range neededRange = currentWS.Range["A1", ((Microsoft.Office.Interop.Excel.Range)currentWS.Cells[nRowCount, nColumnCount])];
    

    That should work like a charm. And for future reference, put the relevant code that you are using inside of your question. Don't make people ask for it in comments. I imagine that's why you got downvoted.

提交回复
热议问题