是否可以从Excel.Worksheet的行和列索引中检索单元格的值?我需要遍历所有行和列并获取值...
For row As Integer = 1 To worksheet.UsedRange.Rows.Count
For col As Integer = 1 To worksheet.UsedRange.Columns.Count
list.Add(worksheet.Cells(row, col)) 'this doesn't return the value of the cell
Next
Next
答案 0 :(得分:0)
尝试:
list.Add(worksheet.Cells(row, col).Value2)
答案 1 :(得分:0)
list.Add(worksheet.Cells(row, col).Value)