I wanted to use the same macro on a Linux PC running Ubuntu, initially it had LibreOffice 4.2.something and the macro did not work with the below error, I removed this version and installed 4.4.6.3 on the Linux machine thinking this was the use but I still have the same problem.
Everytime I exdecute the macro on the Linux PC I get the error "Object variable not set" pointing to the line "Num_Found = Search_Result.Count"
Here is the code that works fine on the first PC and causes the error on the second:
Code: Select all
oSheet = eSheets.nextElement()
ColA = oSheet.getCellrangeByName("A1:A65536")
Search_Desc = ColA.createSearchDescriptor()
Search_Desc.SearchString = "Script #:"
Search_Result = ColA.findAll(Search_Desc)
Num_Found = Search_Result.Count
Last_Occur = Search_Result.getByIndex( Num_Found - 1)
CellAddr = Last_Occur.CellAddress
oRow = CellAddr.Row
oCol = CellAddr.Column
NewCell = oSheet.getCellByPosition(oCol + 1, oRow)
NewCell.String = "TEST_TEST"