Tools: asp.net VB, SpreadsheetGear 2010
I need to read in Excel files from external users and I do not control the format. There are 3 sections of data. I am able to read in the header. The challenge is that the body details can contain an infinite number of rows, and sometimes those rows are blank. I can determine the footer row because there is a piece of text that is unique. Therefore I can perform the following:
Dim dFoot As SpreadsheetGear.IRange = worksheet.Cells("20:21").Rows
Dim rngDet As SpreadsheetGear.IRange
rngDet = dFoot.Find(what:="UNIQUE TEXT HERE",
lookIn:=SpreadsheetGear.FindLookIn.Values,
lookAt:=SpreadsheetGear.LookAt.Whole,
searchOrder:=SpreadsheetGear.SearchOrder.ByColumns,
searchDirection:=SpreadsheetGear.SearchDirection.Next,
matchCase:=False,
after:=dFoot)
Unfortunately, I am now stuck here. I cannot determine where the cell is (i.e. V79) or how to move 7 columns over and 3 down to get the first value for inserting. I have tried offset and different methods of reading the rngDet
, but no luck. I have also tried rngDet.Activate()
to read the active cell, but it does not work the same as Microsoft.
I appreciate any help you can provide.