Hi Kohei,

Alle 14:42, marted� 17 maggio 2005, Kohei Yoshida ha scritto:
[...]
> Looks very nice.  I'm looking forward to using it for my next contribution.

thank you! :-)

and here there's your snippet edited with the new version of the wizard
I added version & platform informations and some auto-IDL linking 


ciao
Paolo
<?xml version="1.0"?>
<!--
$RCSfile: $
last change: $Revision: $ $Author: $ $Date: $

(c)2003 by the copyright holders listed with the author-tags.
If no explicit copyright holder is mentioned with a certain author,
the author him-/herself is the copyright holder. All rights reserved.

Public Documentation License Notice:

The contents of this Documentation are subject to the
Public Documentation License Version 1.0 (the "License");
you may only use this Documentation if you comply with
the terms of this License. A copy of the License is
available at http://www.openoffice.org/licenses/PDL.html

The Original Documentation can be found in the CVS archives
of openoffice.org at the place specified by RCSfile: in this header.

The Initial Writer(s) of the Original Documentation are listed
with the author-tags below.

The Contributor(s) are listed with the author-tags below
without the marker for being an initial author.

All Rights Reserved.
-->

<snippet language="OOBasic" application="Calc">

<keywords>
        <keyword>built-in function</keyword>
        <keyword>function</keyword>
        <keyword>min</keyword>
</keywords>

<authors>
        <author id="kohei" initial="true" email="[EMAIL PROTECTED]" 
copyright="Kohei Yoshida">Kohei Yoshida</author>
        <author id="paolomantovani" initial="false" email="[EMAIL 
PROTECTED]">Paolo Mantovani</author>
</authors>

<question heading="Call built-in functions">

</question>

<answer>
<p>To use Calc&apos;s built-in functions in Basic macro, you need to first 
create a service object of [EMAIL PROTECTED] 
com.sun.star.sheet.FunctionAccess}, and call the method 
&quot;callFunction&quot;.  Arguments are passed to this method as an array 
object even if there is only one argument.  If the argument is a cell range, a 
cell range object must first be created, and passed into an array object before 
it is injected into the callFunction method (see the example code).</p>
<listing>
Sub callFunction

       svc = createUnoService( &quot;[EMAIL PROTECTED] 
com.sun.star.sheet.FunctionAccess}&quot; )

       &apos; Calculate min of numbers.
       arg = array( 10, 23, 5, 345 )
       print svc.callFunction( &quot;MIN&quot;, arg )

       &apos; Calculate min of values in cell range A1:A17
       oSheet = ThisComponent.Sheets(0) &apos; Get leftmost sheet
       oCellRange = oSheet.getCellRangeByPosition( 0, 0, 0, 16 ) &apos;A1:A17
       arg = array( oCellRange )
       print svc.callFunction( &quot;MIN&quot;, arg )

End Sub
</listing>
</answer>

<versions>
        <version number="1.0.x" status="may_work"/>
        <version number="1.1.x" status="tested"/>
        <version number="2.0.x" status="may_work"/>
</versions>

<operating-systems>
<operating-system name="All"/>
</operating-systems>

<changelog>
        <change author-id="kohei" date="2005-04-26">Initial version</change>
        <change author-id="paolomantovani" date="2005-05-17">added 
platform&amp;version informations and auto-IDL linking</change>
</changelog>

</snippet>

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

Reply via email to