Question
In an Excel file, the cells are defined as below. I wanted to get the row which aaa =111. I thought the first is to call
GoExcel.FindRowStart = 3, because GoExcel.FindRowStart is 2 in default. But, FindRow failed after FindRowStart = 3. It says:
Could not match the column title: "aaa"
GoExcel.Open("Book1.xlsx", "Sheet1")
GoExcel.FindRowStart = 3
i = GoExcel.FindRow("Book1.xlsx", "Sheet1", "aaa", "=", 111)
MessageBox.Show(i.Tostring(), "Title")
Solution
There is another property: TitleRow. You also have to set that. (Or you can set TitleRow only, and FindRowStart will be set automatically to TitleRow+ 1). Here’s a modified version of the rule:
GoExcel.Open("Book1.xlsx", "Sheet1") GoExcel.TitleRow = 2 GoExcel.FindRowStart = 3
' or set TitleRow only if you are sure the start row is TitleRow +1 i = GoExcel.FindRow("Book1.xlsx", "Sheet1", "aaa", "=", 111) MessageBox.Show(i.Tostring(), "Title")