14

I've written a bunch of VBA code for various things in Excel. I'm looking at migrating to libreOffice. Under Tool->Macros->Organize Macros: the two choices are LibreOffice Basic and Python.

Should I learn one of those, both, or something else. Am I wasting my time altogether? Any suggestions appreciated.

DBWeinstein
  • 8,605
  • 31
  • 73
  • 118
  • 4
    Python is a more powerful and pleasant language, IMO. Basic would be closer to VBA. – Mark Ransom Jul 24 '12 at 20:00
  • This seems to be a question only you can answer. Do you know Python already? You seemingly are familiar with VBA, so it might be easier to transfer your VBA code to Basic. Which is your preference? – Ken White Jul 24 '12 at 20:03
  • 1
    I know VBA decently well, but I want these things to work. So, if Python is the way to go, i'll go learn it. – DBWeinstein Jul 24 '12 at 21:34
  • 1
    Best [tutorial I could find](http://christopher5106.github.io/office/2015/12/06/openoffice-libreoffice-automate-your-office-tasks-with-python-macros.html) explains why Python is a good way to go and how to do it. – Jannie Theunissen Aug 19 '16 at 10:08

2 Answers2

18

Python is the way to go.

Start here: http://wiki.python.org/moin/BeginnersGuide

And no, you're not wasting time. You'll look back and say, why didn't I do it sooner.

pat34515
  • 1,959
  • 12
  • 13
  • 2
    Do you know of any tutorials for people who know how to program with Python but don't have experience with LibreOffice macros? – Martin Thoma Feb 21 '15 at 12:08
  • @MartinThoma You can find several of these tutorials [here](https://ask.libreoffice.org/en/question/49125/detailed-tutorial-regarding-libreoffice-to-python-macro-writing-especially-for-calc/). – Anderson Green Aug 08 '16 at 22:07
6

Python's a great skill to learn - I use it for everything. It's the glue language for virtually every tool out there (you can even use it with .Net).

Documentation for Python + LibreOffice is however a bit sketchy currently, although I don't have much experience with Calc.

There is some work-in-progress documentation at http://documenthacker.wordpress.com (or soon www.documenthacker.com). It has examples for working with Writer, rather than Calc, but you might still find it useful.

Jamie Boyle
  • 61
  • 1
  • 1