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.

Eksempel:


    REM Koden nedanfor verkar ikkje på tilleggsfunksjonar. Desse har ein annan  oppkallsprosedyre.
    Function MyVlook(item, InRange As Object, FromCol As Integer)
        Dim oService As Object
        oService = createUnoService("com.sun.star.sheet.FunctionAccess")
        REM Bruk alltid det engelske funksjonsnamnet
        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.

Eksempel:


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

ACCRINT

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

ACCRINTM

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

AMORDEGRC

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

AMORLINC

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

BIN2DEC

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

BIN2HEX

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

BIN2OCT

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

COMPLEX

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

CONVERT

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

COUPDAYBS

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

COUPDAYS

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

COUPDAYSNC

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

COUPNCD

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

COUPNUM

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

COUPPCD

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

CUMIPMT

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

CUMPRINC

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

DEC2BIN

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

DEC2HEX

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

DEC2OCT

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

DELTA

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

DISC

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

DOLLARDE

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

DOLLARFR

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

DURATION

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

EDATE

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

EFFECT

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

EOMONTH

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

ERF

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

ERFC

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

FACTDOUBLE

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

FVSCHEDULE

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

GCD

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

GESTEP

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

HEX2BIN

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

HEX2DEC

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

HEX2OCT

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

IMABS

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

IMAGINARY

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

IMARGUMENT

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

IMCONJUGATE

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

IMCOS

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

IMCOSH

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

IMCOT

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

IMCSC

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

IMCSCH

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

IMDIV

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

IMEXP

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

IMLN

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

IMLOG10

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

IMLOG2

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

IMOPPHØG

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

IMPRODUKT

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

IMREELL

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

IMSEKANT

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

IMSEKANTH

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

IMSIN

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

IMSINH

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

IMROT

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

IMSUB

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

IMSUMMER

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

IMTAN

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

RENTESATS

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

ERPARTAL

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

ERODDETAL

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

MFM

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

MPERIODAR

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

MRUND

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

MULTINOMINELL

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

NETTO.ARBEIDSDAGAR

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

NOMINELL

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

OKTTILBIN

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

OKTTILDES

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

OKTTILHEKS

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

AVVIKFP.PRIS

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

AVVIKFP.AVKASTNING

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

AVVIKSP.PRIS

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

AVVIKSP.AVKASTNING

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

PRIS

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

PRIS.DISKONTERT

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

PRIS.FORFALL

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

KVOTIENT

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

TILFELDIGMELLOM

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

MOTTEKEN.AVKAST

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

SUMMER.REKKJE

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

ROTPI

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

TBILLEKV

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

TBILLPRIS

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

TBILLAVKASTNING

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

VEKENR

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

ARBEIDSDAG

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

XIR

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

XNNV

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

ÅRDEL

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

AVKAST

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

AVKAST.DISKONTERT

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

AVKAST.FORFALL

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


Støtt oss!