I encounter the same error as in this old topic above.
pyuno._createUnoStructHelper: member ‘Context’ of struct type ‘com.sun.star.uno.Exception’ not given a value.
I use the sample script HelloWorldPython with Libreoffice stable 5.0.6.3.
The sample script works perfectly when in the sample folder. I simply moved it to the My Macros folder and it threw the error.
I can’t apply the fix detailed in the old topic as apparently it has been fixed in libreoffice updates (the “Scripts” folder has already a capital)
I tried in versions 4.4 and 5.1x64 but the error is exactly the same.
Edit : I installed the latest java x86 & x64, no progress…
Edit 2 : Here is the script.
def HelloWorldPython( ):
"""Prints the string 'Hello World(in Python)' into the current document"""
#get the doc from the scripting context which is made available to all scripts
desktop = XSCRIPTCONTEXT.getDesktop()
model = desktop.getCurrentComponent()
#check whether there's already an opened document. Otherwise, create a new one
if not hasattr(model, "Text"):
model = desktop.loadComponentFromURL(
"private:factory/swriter","_blank", 0, () )
#get the XText interface
text = model.Text
#create an XTextRange at the end of the document
tRange = text.End
#and set the string
tRange.String = "Hello World (in Python)"
return None
Edit 3 : This annoying popup