How can I construct simple LibreOffice basic wrapper, that could read an arbitrary array from LO calc spreadsheet to preform some python function on it, say add all the values?
Here is example of some function. What I want is to do say sum of arrays, not cell values as it does. So, what changes should I implement?
Function readpy(a, b, funcfilename As String, funcname As String) As Variant
Dim oScriptProvider As Object
Dim oScript As Object
Dim result As Variant
oScriptProvider = ThisComponent.getScriptProvider()
oScript = oScriptProvider.getScript(_
"vnd.sun.star.script:" & funcfilename & "$" & funcname & "?language=Python&location=document")
result = oScript.invoke(Array(a, b), Array(), Array())
readpy = result
End Function