If you have a document with some macros, one basic and one python (if this is even possible), can anyone provide an example of how to call something like a python HelloWorld script from a basic SUB or FUNCTION?
Hello @EasyTrieve, this works for me:
Sub Call_HelloWorld
Dim oScriptProvider, oScript
oScriptProvider = ThisComponent.getScriptProvider()
oScript = oScriptProvider.getScript("vnd.sun.star.script:HelloWorld.py$HelloWorldPython?language=Python&location=share")
oScript.invoke(array(), array(), array())
End Sub
1 Like
@librebel Thanks for share
. The wiki doesn’t list that and I’ve been using user
and document
. Don’t think I really need it, but good to know. So far in early going don’t see much need to call from basic.
yw @Ratslinger, i also noticed it for the first time when setting the python macro in a buttton Execute action event, and it was displayed as “HelloWorld.py$HelloWorldPython (share, Python)”