Building a function to evaluate a string and return the results. However, svc and svc2 through an error, "Object Not Set". Though, when I run the code, the print statements clearly show that the objects are not null or nothing as they return FALSE.
What am I missing?
Is there another test that I could preform to make sure svc or svc2 are initialized?
Option VBASupport 1
Option Explicit
Function EVAL (str as String)
dim svc as object
dim svc2 as object
SET svc = createUnoService( "com.sun.star.sheet.FunctionAccess" )
SET svc2 = GetProcessServiceManager().createInstance("com.sun.star.sheet.FunctionAccess")
EVAL = svc2.callFunction ("Evaluate", str)
EVAL = svc.callFunction ("Evaluate", str)
End Function
I now get error 91, cannot coerce argument during core reflection call!
Note: as noted in a response to this problem, there is an unresolved error in LibreOffice when calling Evaluate, so this problem will most likely remain unresolved until OpenOffice resolves their bug. =(