What programming languages are Libreoffice Macros written in, and which one should I focus on in order to create my own (mostly simple) macros?

I’m looking to find someone close to where I live for face-to-face support programming Macros in Libreoffice, however most companies don’t want to touch it as it isn’t a Microsoft product…

So, to my question: which programming language should I focus on to achieve the aforementioned goal?
Once I know this I could simply seek out someone competent in the appropriate language rather than asking for ‘help with Libreoffice’.

It’s worth noting that I don’t know any coding language; I have no prior knowledge whatsoever. All I know is simple formulae from having taught myself to use Libreoffice.

Thanks as always.

It depends entirely on what you want. Python would be a better language, but there is more of a bump in learning just starting out. LO BASIC has the least resistance. If all you want to do is manipulate some numbers or text and have that show up in a cell, then start with BASIC.

Function MyResult(Source1, Source2)
   MyResult = Source1 + Source2
End Function

.
Then you can use =MyResult(A1,B1) to add A1 and B1.
.
Once you start wanting to change other cells, look up values, change colors, etc., LO macro programming becomes very difficult. It is based on UNO, which is a vast “under-the-hood” set of programming pieces that all have to be manipulated just-so to work at all. @Villeroy has compared it to learning to fly in a 747.

Do a search on this site for “BASIC resources,” etc., to get links for beginning material.

Don’t be too cynical about Microsoft on this. If I were a company I would site license Microsoft Office unless I had a very, very special developer pool. When I go back and do macro work in MS it is like LO was distance training with weights on my ankles. LO programming is not like the LO “normal” user experience, which does rival MS in many ways.

Choose any programming language you are familiar with out of Java, JavaScript, Python or Basic. It does not matter that much. The difficult thing with the steep learning curve is the thing you talk to in either language. If you are not familiar with any programming language, this is an inapropriate field of interest.

Sorry, could you please elaborate on what you mean by “inappropriate field of interest?”
Do you mean to say that, in order to have any chance whatsoever at programming macros, I’d need to have some prerequisite knowledge regarding a programming language? That I’d more or less be wasting my time trying to learn along the way?

1 Like

Exactly…more or less!

Villeroy is quite knowledgeable int this area, however, I’d suggest (I don’t know) that his first language is not English. His comment, “this is an inapropriate field of interest” might well have meant that you should learn on one of the aforementioned languages and is and appropriate field to investigate.

Sorry this will not work. The “big” part is to know where to find something in OpenOffice or LibreOffice, wich means you have to deal with the UNO-Libary, maybe files in odf-formats etc. And this is a big eco-system someone has to learn, much bigger than the usual standard-library of a programming language.
.
Compare it to a taxi-driver moving from London to Paris. Changing the car is one point, but knowing how to drive from Buckingham Palace to Harrods wont help for the route from Versailles to Gallery Lafayette.
.
So for help you need people familiar with OpenOffice/LibreOffice or willing to learn a lot. Most simple examples are found for Basic. And the usual starting point for macros is Andrew Pitonyaks Macros eplained at
https://www.pitonyak.org/oo.php

PS: As I read some miutes ago in another thread

I don’t understand why people on forums often answer anything other than the question asked. It’s mind-boggling.

Short answer: BASIC - good luck with this

If I am reading this right, in order to do a simple search and replace for 48 characters, I either have to record all 48 (plus) changes one at a time in the document, or learn/relearn a programming language from scratch?

The same applies for anything more complex, like finding a header and marking it.

You don’t read this right, as your topic is not mentioned here. The question here was “I will use macros → Wich language?”
.
Open your own question and explain better, what you wish to replace.
A lot of things can be done with regular expressions, extensions like Alt-search etc and “search and replace” can be done/started via macro recorder.

I did read that write: in order to write or edit even the simplest macro, I need to learn a programing language from scratch. I can pick one of four, but I still have to take the time to learn that language.

It doesn’t really make a difference what I’m trying to replace, either I record each change for all fifty changes, or I can spend a week or two learning a new programing language to copy, paste, and edit the same set of code 49 times. Not worth the effort for a W/P which I rarely use.

What is so surprising here? I speak or read several languages from western europe. If I wish to write or edit even the simplest sentence in chinese, korean, russian I need to learn a new language from scratch
.
There are ways around it, but if I wish to edit something I have to learn it first, or I will not understand what is there.
.
This is nothing new. British museum has some nice hand painted porcellain, where the chinese painter(s) also copied the english instructions on coloration at the sides of the painting, as they could not read that letters.

Blockquote [quote=“Original_Memory6188, post:9, topic:81394”]
in order to write or edit even the simplest macro, I need to learn a programing language from scratch. I can pick one of four, but I still have to take the time to learn that language.
[/quote]

What is so surprising here? I speak or read several languages from western europe. If I wish to write or edit even the simplest sentence in chinese, korean, russian I need to learn a new language from scratch
.
There are ways around it, but if I wish to edit something I have to learn it first, or I will not understand what is there.
.
This is nothing new. British museum has some nice hand painted porcellain, where the chinese painter(s) also copied the english instructions on coloration at the sides of the painting, as they could not read that letters.

In sum it is this: As little as I use Writer, dedicating the time to learn a programing language in order to write a macro is not cost effective.

There may be a misunderstanding.
If you want something like “document automation” for documents opened in LibreOffice, the most important thing is to master the API (ApplicationProgrammingInterface) used by LibO.
The fact that commercial providers are reluctant to offer such services is most likely not due to a lack of knowledge of Basic or Python, but to the fact that they do not have anyone who is sufficiently familiar with this API and that they do not want to spend the time to acquire this knowledge. There are, however, plenty of MS “engineers” for whatever, and MS-Office Apps have their specific VBA merging language and API into one.
Something that can be seen as an attempt to somehow merge learning of the native dialect of Basic and the API for OO.o, AOO, LibO, … is “The Book” meaning a famous text by Andrew Pitonyak under the title “OpenOffice.org Macros Explained”. But this text addresses people who want to learn and do themselves. The API parts are then also useful for those who want to change to a different programming language. (Just debugging is in addition available as a functionality of the native small IDE.)

looks very similar to VBA, but it’s not, lol… https://wiki.documentfoundation.org/Documentation/BASIC_Guide