I need to understand this, it is the most common error that I get when trying to write macro's in Open Office? The latest one is from a bit of code I found on here funnily enough to loop through a range of Cells, unfortunately I can't get it going so can't learn anything from it. If someone could explain what the error means that would really help.
Code: Select all
Dim Doc, Sheet, Descript, Cell, CellRange as object
Dim i as integer
Doc = ThisComponent
Sheet = Doc.Sheets(0)
For i = 2 to 6
CellRange = Sheet.getCellRangeByPosition(2,i,4,i)
Descript = CellRange.createSearchDescriptor()
Descript.SearchString = "54321"
Descript.SearchWords = True 'If true, the search will match only complete words
Cell = CellRange.findFirst(Descript)
If Not IsNull(Cell) then
Print "Row = " + (Cell.CellAddress.Row + 1)
End if
next i
and judging by the thank yous it must have worked at some point but as the thread was 2009 I can only assume that the syntax has now changed as noted in the line:
Code: Select all
CellRange = Sheet.getCellRangeByPosition
Code: Select all
CellRange = Sheet.getCellByPosition
Regards
ifunct