Problem with MoveCursorToEnd - xlToRight

I’m following the explanation from this PDF: “http://www.openoffice.org/documentation/HOW_TO/various_topics/VbaStarBasicXref.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: 6.2.5.2 (x64)

Cheers

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")
ThisComponent.CurrentController.select(oCell)

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

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.

Cheers