HRESULT: 0x800A03EC on Worksheet.range

前端 未结 23 2154
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:17

    I had the same error code when executing the following statement:

    sheet.QueryTables.Add("TEXT" & Path.GetFullPath(fileName), "1:1", Type.Missing)
    

    The reason was the missing semicolon (;) after "TEXT".

    Here is the correct one:

    sheet.QueryTables.Add("TEXT;" & Path.GetFullPath(fileName), "1:1", Type.Missing)
    

提交回复
热议问题