Problem with MoveCursorToEnd - xlToRight

I’m following the explanation from this PDF: “ - page 23” to learn about the difference between VBA and LO Basics.

When I run the code followed bellow I get this error message: “Execution Error BASIC: 35 - MoveCursorToEnd”

Someone can explain me if this is a bug or if is there something wrong in my code?

*my LibreOffice version: (x64)


Dim oSheet as Object, oCell as Object

'''get some useful objects
oSheet = ThisComponent.CurrentController.ActiveSheet

'''go to upper slef corner of range
oCell = oSheet.getCellRangeByName("H3")

'Find the last cell in the current row
'this takes cursor to cell E3
oCell = MoveCursorToEnd(oCell,"xlToRight")

MoveCursorToEnd is a user defined function, which is mentioned at the start of the page:

'''This code fragment makes use of a user defined function
'''MoveCursorToEnd() documented in Appendix B. 

Have you included it in your module/library? If so, check if you have copied this function without PDF manual’s headers/footers.

Thank you SM_Riga.

I didn’t create the Support Module. After that everything is working fine.