On 05/26/09 16:20, Jeremy Trudel wrote:
Here is a snippet of my code:

                XCellRange xRange =
(XCellRange)UnoRuntime.queryInterface(XCellRange.class, range);

                Object[] array = new Object[1];

                array[0] = xRange;

                Object ret = xFunctionAccess.callFunction("COUNTA", array);

Make sure to pass the argument with the right type. Instead of
 array[0] = xRange;
use
 array[0] = new com.sun.star.uno.Any(XCellRange.class, xRange);
I have to admit I don't know if this is supposed to make a difference, but apparently it does.

This produces an IllegalArgumentException. If I replace the XCellRange
argument with say:

Object[] array = new Object[5];

array[0] = "A1";

array[1] = "A2";

array[2] = "A3";

array[3] = "A4";

array[4] = "A5";

Then it works, but my return value for the callFunction() method returns me
the result of the first spreadsheet every time, instead of the active sheet
I have set.

This counts the five strings you passed, not any cell content.

Niklas

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to