It is a long shot, but you might be able to use:

com.sun.star.sheet.FunctionAccess

Worst case, you need to write an add-in :-(

It may also be possible to store the oObjFactor and RInterface in a Global variable to sepeed things up. You will need to test to see if they are null or empty and then create them if they are not. I do not know the potential problems with this, of course.....

Ing. Sandro Vanin wrote:
I'm translating many macros from VBA to openoffice basic: the only my problem is to translate the VBA function evaluate(....), for example
x="3*8+4^2".
y=Evaluate(x)

I need this function since I have to show the details of my calculations.
I've solved the problem as follow:

Function cal(testo As String) As Double
   oObjFactory = createUnoService( "com.sun.star.bridge.OleObjectFactory" )
   RInterface = oObjFactory.createInstance( "StatConnectorSrv.StatConnector" )
   call RInterface.Init("R")
   cal = RInterface.Evaluate(testo)
End Function

BUT IN THIS WAY MY CALC SHEETS ARE VERY SLOW !!!!!
Thank you in advance

Sandro

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html

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

Reply via email to