Jahn, Ray (R.) wrote:

Hi:

OS = MS Windows 2000

in OO Basic inside OO Calc 1.9.95
writedbginfo( sheet_object ) indicates no
FunctionAccess  service
XFunctionAccess interface

in DeveloperGuide, version 2.0
8.4.2 Function Handling
com.sun.star.sheet.FunctionAccess  service
com.sun.star.sheet.XFunctionAccess interface

I am at a loss as how to call the built-in spreadsheet functions from scripts 
in OO 1.9.95, given the apparent conflict above.  An equivalent example in MS 
Excel VBA is given below.  Please advise if there is a better documentation to 
follow.

Thanks.

Ray

--- MS Excel VBA equivalent example

dim answer as double
answer = Application.min( num_1, cellobj_2, rangeobj_3, num_4 )

' same as the following
' answer = Application.WorksheetFunction.min( num_1, cellobj_2, rangeobj_3, num_4 )


FunctionAccess is not supported by the Sheet object, it is available form the global service manager. You can query the global service manager and see what objects are supported if you like. To create one, simply use4 the following:

*CreateUnoService("com.sun.star.sheet.FunctionAccess")*


So, you finally have:

Dim oFunction   'Use FunctionAccess service to call the Now function
oFunction = CreateUnoService("com.sun.star.sheet.FunctionAccess")
oFunction.NullDate = ThisComponent.NullDate
oFunction.callFunction("NOW", Array())

Inspect the value returned from the above call...

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to