I have the following problem. I have to read the excel file through COM interop. I am new to programming using COM interoperability.
I am looking 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 found Range as a starting point to get another range.
Something like that
Excel.Range MyRange = this.sheet.Range[foundRange + 2 rows, + 1 column & lastRow];
I see no way to do this. There is one?
c # excel range com-interop
mrt181
source share