Hello All,
I'm trying to follow a tutorial on github ("openoffice-libreoffice-automate-your-office-tasks-with-python-macros"), and I can only get about 5 lines in before I raise an error.
Import socket
import uno
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext('com.sun.star.bridge.UnoResolver', localContext)
ctx = resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'resolve'
This is all entered from the python shell in OpenOffice 4\programs\python.exe
I've scoured the forum(and the web in general) but I haven't seen anyone encounter this error. If anyone can point me in the right direction i would certainly appreciate it.
[Solved] Python resolver.resolve Attribute Error 'NoneType'
[Solved] Python resolver.resolve Attribute Error 'NoneType'
Last edited by Siddmonk on Mon Feb 05, 2018 10:16 pm, edited 2 times in total.
OpenOffice 4, Windows 10 Pro
Re: Python resolver.resolve Attribute Error 'NoneType'
Have you a document open to which to connect?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Python resolver.resolve Attribute Error 'NoneType'
Yes the document was also launched from the command line soffice --writer "accept=socket,host=localhost,port=2002;urp;"
And is open when I make the call to resolver.resolve
And is open when I make the call to resolver.resolve
OpenOffice 4, Windows 10 Pro
Re: Python resolver.resolve Attribute Error 'NoneType'
Just realized I had installed uno globally and wasn't sure if that would cause an error. So I uninstalled it and I no longer get the error. Thank you for your help.
OpenOffice 4, Windows 10 Pro