That code is not written in LibreOffice Basic, so of course, it doesn’t work.
To get started with Basic, see for example www.pitonyak.org/oo.php. Also, Option Compatible
is confusing for beginners. I would not recommend it unless you need certain specialized functions that Basic cannot normally do.
Python and Java are also good languages for LibreOffice macros.
EDIT:
some macros work perfectly
Some code may work on both platforms, but not most things, and some code that seems to work may fail in unexpected ways. Remove Option Compatible
to help avoid unpleasant surprises.
I recorded a macro in libre to see the differences
Recording is generally not a good way to learn, at least not for beginners. The resulting dispatcher code is ugly and often not the best way to do things. It is good for special operations like copy and paste though.
I can barely read VB code as it is I was just wondering if there was a way to convert the VBA to libre.
Think of it as rewriting, not converting. These are programming languages, not just file formats.
With some effort, Basic macros can be learned. However, from your comment, it sounds like you are not up for the task, so you may need a different solution. For example, hire someone who can write LibreOffice macros.