I want to read a particular column data from worksheet based on column name and store those values into Array or List. I have written the code to read particular sheet from workbook but now I want to ignore empty cells and find out particular column then want to read those data.
For example, let say I have a column with header "pAge" how I can I skip empty cells then find and loop into the column and read all the values from this particular column.
I want to write a logic which should not cost application performance.
Can someone please help me achieve this logic using C# Microsoft Interop?
oExcel = new Excel.Application();
oWorkBook = oExcel.Workbooks.Open(myExcel);
oWorksheet = oWorkBook.Worksheets.OfType<Excel.Worksheet>().FirstOrDefault(ws => ws.Name.Equals(mySheet));