Calling Calc Functions

In addition to the native BASIC functions, you can call Calc functions in your macros and scripts.

Calling Internal Calc functions in Basic

Use the CreateUNOService function to access the com.sun.star.sheet.FunctionAccess service.

Ejemplo:


    REM The code below does not work for add-in functions, which have a different calling procedure.
    Function MyVlook(item, InRange As Object, FromCol As Integer)
        Dim oService As Object
        oService = createUnoService("com.sun.star.sheet.FunctionAccess")
        REM Always use the function English name
        MyVlook = oService.callFunction("VLOOKUP",Array(item, InRange, FromCol, True))
    End Function

Calling Add-In Calc Functions in BASIC

The Calc Add-In functions are in service com.sun.star.sheet.addin.Analysis.

Ejemplo:


REM Example calling Addin function SQRTPI
Function MySQRTPI(arg as double) as double
   Dim oService as Object
   oService = createUNOService("com.sun.star.sheet.addin.Analysis")
   MySQRTPI = oService.getSqrtPi(arg)
End Function

Calc Function name

UNO service name

INT.ACUM

com.sun.star.sheet.addin.Analysis.getAccrint

INT.ACUM.V

com.sun.star.sheet.addin.Analysis.getAccrintm

AMORTIZ.PROGRE

com.sun.star.sheet.addin.Analysis.getAmordegrc

AMORTIZ.LIN

com.sun.star.sheet.addin.Analysis.getAmorlinc

BESSELI

com.sun.star.sheet.addin.Analysis.getBesseli

BESSELJ

com.sun.star.sheet.addin.Analysis.getBesselj

BESSELK

com.sun.star.sheet.addin.Analysis.getBesselk

BESSELY

com.sun.star.sheet.addin.Analysis.getBessely

BIN.A.DEC

com.sun.star.sheet.addin.Analysis.getBin2Dec

BIN.A.HEX

com.sun.star.sheet.addin.Analysis.getBin2Hex

BIN.A.OCT

com.sun.star.sheet.addin.Analysis.getBin2Oct

COMPLEJO

com.sun.star.sheet.addin.Analysis.getComplex

CONVERTIR

com.sun.star.sheet.addin.Analysis.getConvert

CUPON.DIAS.L1

com.sun.star.sheet.addin.Analysis.getCoupdaybs

CUPON.DIAS

com.sun.star.sheet.addin.Analysis.getCoupdays

CUPON.DIAS.L2

com.sun.star.sheet.addin.Analysis.getCoupdaysnc

CUPON.FECHA.L2

com.sun.star.sheet.addin.Analysis.getCoupncd

CUPON.NUM

com.sun.star.sheet.addin.Analysis.getCoupnum

CUPON.FECHA.L1

com.sun.star.sheet.addin.Analysis.getCouppcd

PAGO.INT.ENTRE

com.sun.star.sheet.addin.Analysis.getCumipmt

PAGO.PRINC.ENTRE

com.sun.star.sheet.addin.Analysis.getCumprinc

DEC.A.BIN

com.sun.star.sheet.addin.Analysis.getDec2Bin

DEC.A.HEX

com.sun.star.sheet.addin.Analysis.getDec2Hex

DEC.A.OCT

com.sun.star.sheet.addin.Analysis.getDec2Oct

DELTA

com.sun.star.sheet.addin.Analysis.getDelta

TASA.DESC

com.sun.star.sheet.addin.Analysis.getDisc

MONEDA.DEC

com.sun.star.sheet.addin.Analysis.getDollarde

MONEDA.FRAC

com.sun.star.sheet.addin.Analysis.getDollarfr

DURACION

com.sun.star.sheet.addin.Analysis.getDuration

FECHA.MES

com.sun.star.sheet.addin.Analysis.getEdate

INT.EFECTIVO

com.sun.star.sheet.addin.Analysis.getEffect

FIN.MES

com.sun.star.sheet.addin.Analysis.getEomonth

FUN.ERROR

com.sun.star.sheet.addin.Analysis.getErf

FUN.ERROR.COMPL

com.sun.star.sheet.addin.Analysis.getErfc

FACT.DOBLE

com.sun.star.sheet.addin.Analysis.getFactdouble

VF.PLAN

com.sun.star.sheet.addin.Analysis.getFvschedule

M.C.D

com.sun.star.sheet.addin.Analysis.getGcd

MAYOR.O.IGUAL

com.sun.star.sheet.addin.Analysis.getGestep

HEX.A.BIN

com.sun.star.sheet.addin.Analysis.getHex2Bin

HEX.A.DEC

com.sun.star.sheet.addin.Analysis.getHex2Dec

HEX.A.OCT

com.sun.star.sheet.addin.Analysis.getHex2Oct

IM.ABS

com.sun.star.sheet.addin.Analysis.getImabs

IMAGINARIO

com.sun.star.sheet.addin.Analysis.getImaginary

IM.ANGULO

com.sun.star.sheet.addin.Analysis.getImargument

IM.CONJUGADA

com.sun.star.sheet.addin.Analysis.getImconjugate

IM.COS

com.sun.star.sheet.addin.Analysis.getImcos

IM.COSH

com.sun.star.sheet.addin.Analysis.getImcosh

IM.COT

com.sun.star.sheet.addin.Analysis.getImcot

IM.CSC

com.sun.star.sheet.addin.Analysis.getImcsc

IM.CSCH

com.sun.star.sheet.addin.Analysis.getImcsch

IM.DIV

com.sun.star.sheet.addin.Analysis.getImdiv

IM.EXP

com.sun.star.sheet.addin.Analysis.getImexp

IM.LN

com.sun.star.sheet.addin.Analysis.getImln

IM.LOG10

com.sun.star.sheet.addin.Analysis.getImlog10

IM.LOG2

com.sun.star.sheet.addin.Analysis.getImlog2

IM.POT

com.sun.star.sheet.addin.Analysis.getImpower

IMPRODUCT

com.sun.star.sheet.addin.Analysis.getImproduct

IMREAL

com.sun.star.sheet.addin.Analysis.getImreal

IMSEC

com.sun.star.sheet.addin.Analysis.getImsec

IMSECH

com.sun.star.sheet.addin.Analysis.getImsech

IMSIN

com.sun.star.sheet.addin.Analysis.getImsin

IMSINH

com.sun.star.sheet.addin.Analysis.getImsinh

IMSQRT

com.sun.star.sheet.addin.Analysis.getImsqrt

IMSUB

com.sun.star.sheet.addin.Analysis.getImsub

IMSUM

com.sun.star.sheet.addin.Analysis.getImsum

IMTAN

com.sun.star.sheet.addin.Analysis.getImtan

INTRATE

com.sun.star.sheet.addin.Analysis.getIntrate

ISEVEN

com.sun.star.sheet.addin.Analysis.getIseven

ISODD

com.sun.star.sheet.addin.Analysis.getIsodd

LCM

com.sun.star.sheet.addin.Analysis.getLcm

MDURATION

com.sun.star.sheet.addin.Analysis.getMduration

MROUND

com.sun.star.sheet.addin.Analysis.getMround

MULTINOMIAL

com.sun.star.sheet.addin.Analysis.getMultinomial

NETWORKDAYS

com.sun.star.sheet.addin.Analysis.getNetworkdays

NOMINAL

com.sun.star.sheet.addin.Analysis.getNominal

OCT2BIN

com.sun.star.sheet.addin.Analysis.getOct2Bin

OCT2DEC

com.sun.star.sheet.addin.Analysis.getOct2Dec

OCT2HEX

com.sun.star.sheet.addin.Analysis.getOct2Hex

ODDFPRICE

com.sun.star.sheet.addin.Analysis.getOddfprice

ODDFYIELD

com.sun.star.sheet.addin.Analysis.getOddfyield

ODDLPRICE

com.sun.star.sheet.addin.Analysis.getOddlprice

ODDLYIELD

com.sun.star.sheet.addin.Analysis.getOddlyield

PRICE

com.sun.star.sheet.addin.Analysis.getPrice

PRICEDISC

com.sun.star.sheet.addin.Analysis.getPricedisc

PRICEMAT

com.sun.star.sheet.addin.Analysis.getPricemat

QUOTIENT

com.sun.star.sheet.addin.Analysis.getQuotient

RANDBETWEEN

com.sun.star.sheet.addin.Analysis.getRandbetween

RECEIVED

com.sun.star.sheet.addin.Analysis.getReceived

SERIESSUM

com.sun.star.sheet.addin.Analysis.getSeriessum

SQRTPI

com.sun.star.sheet.addin.Analysis.getSqrtpi

TBILLEQ

com.sun.star.sheet.addin.Analysis.getTbilleq

TBILLPRICE

com.sun.star.sheet.addin.Analysis.getTbillprice

TBILLYIELD

com.sun.star.sheet.addin.Analysis.getTbillyield

WEEKNUM

com.sun.star.sheet.addin.Analysis.getWeeknum

WORKDAY

com.sun.star.sheet.addin.Analysis.getWorkday

XIRR

com.sun.star.sheet.addin.Analysis.getXirr

XNPV

com.sun.star.sheet.addin.Analysis.getXnpv

YEARFRAC

com.sun.star.sheet.addin.Analysis.getYearfrac

YIELD

com.sun.star.sheet.addin.Analysis.getYield

YIELDDISC

com.sun.star.sheet.addin.Analysis.getYielddisc

YIELDMAT

com.sun.star.sheet.addin.Analysis.getYieldmat


¡Necesitamos su ayuda!