I've asked here about the good way to do so.
Now I'm trying the following code found here, and get some unexpected errors.
I suppose I'm not using it the correct way. Any idea ?
Sub Main
Dim aResult
Dim aFunc
Dim oRange
aFunc = GetProcessServiceManager().createInstance("com.sun.star.sheet.FunctionAccess")
aResult = aFunc.callFunction("SUM", Array(1, 2, 3))
' ---- Works OK
Print aResult
aResult = aFunc.callFunction("MDETERM", Array(2, 5, 8))
' ---- IllegalArgumentException
Print aResult
oRange = ThisComponent.sheets(0).getcellrangebyname("B4:B6")
aResult = aFunc.callFunction("ZTEST", Array(oRange, 2.5, 1.0))
' ---- IllegalArgumentException
Print aResult
End Sub