To use Calc's built-in functions in Basic macro, you need to first create a service object of {@link com.sun.star.sheet.FunctionAccess}, and call the method "callFunction". 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).