[Solved] Use Edit button with python script
Posted: Fri Jan 31, 2025 3:53 am
Install package:
Make directory to store python script.
Edit my first python script:
Now click buttons on the menu in LibreOffice Calc "Tools > Organize Macros > Python"
I can only run it,can't edit it with this LibreOffice Calc window. The "Edit" button can't be clicked to use.
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.