Calling a built-in function
Posted: Fri Dec 07, 2007 7:34 am
I'm trying to call built-in functions (as in Excel VBA) and can't get it to work. Based on examples I gather I need to do something like this:
Function calc_Func(sFunc$,args())
dim oFA as Object
oFA = createUNOService("com.sun.star.sheet.FunctionAccess")
calc_Func = oFA.callFunction(sFunc,args())
end function
Function test(x as double) as double
test =calc_Func("NORMSDIST",x())
End Function
However, when I call test(0.5) I get "Basic runtime error. Object variable not set." with the arrow pointing to the line "calc_func = ofa.callFunction".
How does this work? Thanks.
Bob
Function calc_Func(sFunc$,args())
dim oFA as Object
oFA = createUNOService("com.sun.star.sheet.FunctionAccess")
calc_Func = oFA.callFunction(sFunc,args())
end function
Function test(x as double) as double
test =calc_Func("NORMSDIST",x())
End Function
However, when I call test(0.5) I get "Basic runtime error. Object variable not set." with the arrow pointing to the line "calc_func = ofa.callFunction".
How does this work? Thanks.
Bob