Due to some other functions I use, I must declare "option explicit" in the module.
In this case I must define all variables.
And calc basic does not accept the way I define variables.
I'd be very glad if someone could tell me what is wrong with this code.
Code: Select all
option explicit
sub essayer
dim fndtxt as string
dim searchn as string
fndtxt="."
searchn="aaa.1"
msgbox cFND(fndtxt, searchn)
end sub
function cFND (fndtxt as string, searchn as string)
dim FuncAcc
' The first argument to callFunction() is the Calc Function Name
' The 2nd argument is the parameters of that function as an array
FuncAcc = createunoservice("com.sun.star.sheet.FunctionAccess")
FND = FuncAcc.callFunction( "FIND" , array(fndtxt, searchn))
' msgbox SBST
cFND = FND
End function