C# Reading Excel Data From Cells in VS2010
I am writing a C# Console Application and I am correctly opening an Excel file. I just can't figure out how to read data from cells and copy it into an array. Most of the code I have found list examples that won't work with VS 2010. It appears they have changed how to read cell data in every version. I am wanting to read a variable amount of rows depending on how lon开发者_开发百科g the data goes. I am wanting to read cells [B8]-[*8].
I have spend a couple of days on this without much luck.
Thanks very much, BuZzZzJaY
You can use this method workSheet.get_Range("A1", "A1").EntireRow.EntireColumn
use bellow code this is 2d array. Iterate in this
Object[,] obj = (object[,])sheet.get_Range("A1", "B4").Value2;
精彩评论