Hi Alex,

alex sato schrieb:
Regina, thanks for your answer.

But can you tell me how to call Calc functions inside the macro?
I searched in docs and in the Google and don't found any clue.

It is done with the service FunctionAccess, see http://api.libreoffice.org/docs/common/ref/com/sun/star/sheet/FunctionAccess.html and the there linked section in the Developers guide.

Here a very simple example, how it looks in Basic

function MYPRODUCT (byVal x as double,byVal y as double) as double
dim oFunction as variant
oFunction = createUnoService("com.sun.star.sheet.FunctionAccess")
dim aArgument(1) as variant
dim result as double
aArgument(0)=x
aArgument(1)=y
result = oFunction.callFunction( "PRODUCT", aArgument() )
MYPRODUCT = result
end function

If you search for createUnoService("com.sun.star.sheet.FunctionAccess") you will get a lot of relevant hits.


By the way, just now I tought the possibility to rewrite math functions
using "string" to encode the number to avoid error because I remembered
BCD.  :-)

What is your goal? There is no silver bullet that fits all problems, but perhaps you can get a helpful tip or trick.

Kind regards
Regina

--
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to