

It would be much easier to just write a normal Python script that reads data from the spreadsheet and then writes it back. This appears to require importing a lot of hefty libraries, even the most basic examples require dozens of lines of complex boilerplate code, and debugging is probably a pain. I also found some information about writing Python extensions using some sort of Python interop library. I say "yet" in quotes because I found people complaining about this in 2012 just to be told that it will be fixed any day now. After digging a bit on the internet, I discovered that apparently LibreOffice (well, actually upstream OpenOffice) doesn't have its own Python IDE "yet", so they just put a grayed out button in the UI with no explanation as a placeholder. > Python, the options for creating new macros are grayed out. If I go to Tools > Macros > Organize macros.

I don't really want to learn Basic just for this, I want to leverage my knoweldge and experience in Python. Unfortunately this appears to require writing it in Basic, not Python. This gives me a dialog where I can apparently create a new function in the way I describe above (I haven't tested it). I can go to Tools > Macros > Organize macros.

Bad input or other errors should produce error text in the cell, same as how builtin calc functions do it. I would then be able to write =VOL(A1, A2, B3) in a cell and have it calculate the result. Ideally, I would have a Python file like: def VOL(a, b, c):Įither embedded in the document or as a custom_functions.py file in a straightforward location. Since LibreOffice Calc supports macros, and the builtin functions are somewhat limited, I'd like to write my own functions in Python and then use them as formulas in individual cells.
