i have the following problem. I have to read an excel file through COM interop. I am new to programming with COM interop.
I search for a specific string using this:
this.sheet = (Excel.Worksheet)this.excelApp.Workbook.Sheets.Item[this.sheetname];
this.sheet.Activate();
Excel.Range firstRow = this.sheet.Range["A1", "XFD1"];
Excel.Range foundRange = firstRow.Find(
this.StringISearch,
Type.Missing,
Type.Missing,
Excel.XlLookAt.xlWhole,
Excel.XlSearchOrder.xlByColumns,
Excel.XlSearchDirection.xlNext,
false,
false,
Type.Missing);
No i want to use the foundRange as a starting point to get another range.
Something like this
Excel.Range MyRange = this.sheet.Range[foundRange + 2 rows, + 1 column & lastRow];
I don't see a way to do this. Is there one?