There is an xls file with a lot of lines. I use C #, interop library. Reading takes place in the form of creating a list of objects (one object represents one row) with properties a1, a2 ... a8, which contain the values of the columns of this row. Then the next line, etc. loop for, until I meet an empty string. Then with the help of these objects I conduct analysis. The problem is very slow reading. On the Internet, it is advised to use EPPlus. But, it works with xlsx, I have xls. Hands, through ctrl + a, ctrl + v copying a large number of cells to another sheet takes only a couple of seconds. By analogy, is it possible to somehow select, copy the entire range of filled cells into, say, a two-dimensional array and then work with it? In theory, the speed of an order to increase? If so, how to do it? The number of lines in different files is different. Thank.
My code snippet
//считываем ячейки, пока не встретим пустаю while (true) { excelcells = excelworksheet.get_Range("A" + row.ToString(), Type.Missing); if (excelcells.Value2 == null) { break; } excelcells = excelworksheet.get_Range("C" + row.ToString(), Type.Missing); int AA = Int32.Parse(excelcells.Value2.ToString()); excelcells = excelworksheet.get_Range("H" + row.ToString(), Type.Missing); double BB = (double)excelcells.Value2; excelcells = excelworksheet.get_Range("I" + row.ToString(), Type.Missing); double CC = (double)excelcells.Value2; new ClassRs(AA, BB, CC); row++; }