Code: Select all
sudo apt install libreoffice-script-provider-python
Code: Select all
mkdir -p .config/libreoffice/4/user/Scripts/python
Code: Select all
cd .config/libreoffice/4/user/Scripts/python
vim hello.py
import uno
def HelloWorldPythonCalc():
oDoc = XSCRIPTCONTEXT.getDocument()
oSheet =oDoc.getSheets().getByIndex(0)
oCell = oSheet.getCellByPosition(0,0)
oCell.String = 'Hello World via Python'
return None
I can only run it,can't edit it with this LibreOffice Calc window. The "Edit" button can't be clicked to use.