Configure Libreoffice to listen for uno connection

Running LibreOffice version on Windows 7 pro.

My understanding is if I write Python programs and run them externally to LibreOffice, then LibreOffice must be configured to listen for an uno connection.

How do I configure LibreOffice to listen for an uno connection?


See the answers in this thread
No, ipython notebook ( now jupyter notebook ) is not necessary to run soffice in servermode, but IMHO it’s currently the best Environment for (small) interactiv Development from|with python.

to repeat the essential parts:

# run soffice as 'server'
from subprocess import Popen

officepath = 'soffice' #respectivly the full path
calc = '--calc'
pipe = "--accept=pipe,name=abraxas;urp;StarOffice.Servicemanager"
Popen([officepath, calc, pipe]);


# to connect as client
import uno
from pythonscript import ScriptContext

local = uno.getComponentContext()
resolver = local.ServiceManager.createInstance("")

client = resolver.resolve( "uno:pipe,"
# for the conviniance of prior basic-adopters
createUnoService = client.ServiceManager.createInstance

# for (roughly) the same namespace as from "inside" soffice
XSCRIPTCONTEXT = ScriptContext(client, None, None)
1 Like