I am trying to use Microsoft.Office.Interop.Excel to read excel file in c#. I want to read range of cells as it is way faster than reading cell one by one:
Range rbeg = (Range)sheet.Cells[1, i + 1];
Range rend = (Range)sheet.Cells[totalRowCount, i + 1];
Range range = sheet.get_Range(rbeg, rend);
column = (object[,])range.Value2;
The problem is when I want to get number format of cells by calling:
range.NumberFormat
I get System.DBNull. It works when I call it for single cell.
I want to distinguish between cells with numerical values and "%" values.
Any ideas?