Programming LibreOffice ver 5.4.3.2

I have downloaded the Beta version of LibreOffice and I could not contain my excitement when I saw the opportunity to program my documents using Javascript and Python. Problem is, I do not know how to “attach” my code to the document (in Excel, I right-click on a tab and choose view-code).

I saw somewhere that I need to download the SDK. Is this correct. I basically want to use Javascript or Python in a similar way that I use VBA in excel. I have a very good stand-alone Javascript editor.

Any pointers on where to start my learning-curve would be appreciated. e.g. “Hello World” in a calc-document using Javascript would be good.

Regards

Generally, Python is the preferred choice for LibreOffice macros.

To facilitate creating Python macros, install the APSO extension. This provides a dialog at Tools → Macros → Organize Python scripts. For example, expand “My Macros” and go to the popup Menu → Create Module.

A good introductory Python/LibreOffice tutorial is at
Interface-oriented programming in OpenOffice / LibreOffice : automate your office tasks with Python Macros.

For additional information, one page that I have found beneficial is Transfer from Basic to Python - Apache OpenOffice Wiki. But many other pages could be suggested as well.

In contrast, Javascript support in LibreOffice is buggy and not recommended. However, if you really want Javascript Hello World for Calc then post a separate question and we can explain how.

There is no need to install the SDK for macro programming. The SDK is for writing components in languages such as Java and C++. Java is a useful language for working with LibreOffice as well, but it is not analogous to VBA in Excel.

Nice pointers indeed. Also interesting might be the MRI - UNO Object Inspection Tool, for documentation see RunMRI · hanya/MRI Wiki · GitHub.

Thanks for the advice and good information. I was keen to link my spreadsheets to a browser, hence Javascript but as I have never used Python, I shall have fun trying the language out.

Regards

If this answer was useful, then please mark it correct as described under guidelines for asking. That should give you some reputation points. It also gives me some points and, most importantly, it closes out the question.

If you need help working with the web from a Python macro, feel free to post another question. There are several people who are on this site daily and are experienced with Python macros.