How to read single Excel cell value

前端 未结 7 1906
情深已故
情深已故 2020-11-29 04:04

I have excel file with sheet1 that has a value I need to read on row 2 and column 10. Here is my code.

Excel.Workbook excelWorkbook = excelApp.Workbooks.Ope         


        
相关标签:
7条回答
  • 2020-11-29 04:34

    You need to cast it to a string (not an array of string) since it's a single value.

    var cellValue = (string)(excelWorksheet.Cells[10, 2] as Excel.Range).Value;
    
    0 讨论(0)
提交回复
热议问题