Skip to content

Instantly share code, notes, and snippets.

@sancarn
Last active October 6, 2021 14:07

SAP Analysis for Office has a bunch of defined functions which can be used in VBA or otherwise, This function list was extracted from the BiExcelBase.tlb type library.

Function BExGetCellData(iMemberX As String, iMemberY As String, iDataProviderName As String)
    Member of BiExcelBase.EaExcelFunctions

Function BExGetData(iDataProviderName As String, iDimensionValueList() As String)
    Member of BiExcelBase.EaExcelFunctions

Sub CallbackAfterWorkbookClose()
    Member of BiExcelBase.EaExcelFunctions

Sub CallbackAfterWorkbookSaved()
    Member of BiExcelBase.EaExcelFunctions

Sub CallbackAttributePlanningCellDropDownIconClicked()
    Member of BiExcelBase.EaExcelFunctions

Function CallbackFddIconClicked() As Boolean
    Member of BiExcelBase.EaExcelFunctions

Sub CallbackHeaderCellDropDownIconClicked()
    Member of BiExcelBase.EaExcelFunctions

Function GetHelpUrls(iKeys() As String)
    Member of BiExcelBase.EaExcelFunctions

Function GetLocalizedText(iKey As String, iStdText As String, iVar0 As String, iVar1 As String, iVar2 As String, iVar3 As String, iVar4 As String, iVar5 As String, iVar6 As String, iVar7 As String, iVar8 As String) As String
    Member of BiExcelBase.EaExcelFunctions

Function GetLocalizedTexts(iParam() As String)
    Member of BiExcelBase.EaExcelFunctions

Function GetMinorVersion() As Long
    Member of BiExcelBase.EaExcelFunctions

Sub LoggerWrite(iMessage As String, iSeverity As Long)
    Member of BiExcelBase.EaExcelFunctions

Function SAPAddMessage(iText As String, iSeverity As String, iDetails As String, iMessageId As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPCallMemberSelector(iDpKey As String, iSelectorType As String, iDimensionKey As String, iRefSheetId As <Unsupported variant type>, iRefRow As Long, iRefCol As Long, iSelectionType As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPDeleteDesignRule(iDpKey As String, iRuleID As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPDynGenCondFormats(iDpKey As String, iPresentation As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPDynGenMessages(iPresentation As String, iMessageType As Long)
    Member of BiExcelBase.EaExcelFunctions

Function SAPExecuteCommand(iCommand As String, iParam1 As String, iParam2 As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPExecutePlanningFunction(iAlias As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPExecutePlanningSequence(iAlias As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPFixLineSize(iSizeRuleName As String, iDpKey As String, iVirtualLineId As String, iSize As Long)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetCellInfo(iRefSheetId As <Unsupported variant type>, iRefRow As Long, iRefCol As Long, iProperty As String, iDimensions As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetData(iExcelInternalSheetId As <Unsupported variant type>, col As Long, row As Long, iDpKey As String, iMeasureKey As String, iDimensionMembers() As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetDimensionDynamicFilter(iDpKey As String, iDimensionTechnicalName As String, iPresentation As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetDimensionEffectiveFilter(iDpKey As String, iDimensionTechnicalName As String, iPresentation As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetDimensionInfo(iExcelInternalSheetId As <Unsupported variant type>, col As Long, row As Long, iDpKey As String, iDimensionTechnicalName As String, iPropertyName As String, iPropertyValue As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetDimensionStaticFilter(iDpKey As String, iDimensionTechnicalName As String, iPresentation As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetDisplayedMeasures(iDpKey As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetInfoLabel(iPropertyName As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetMeasureFilter(iDpKey As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetMeasureInfo(iExcelInternalSheetId As <Unsupported variant type>, col As Long, row As Long, iDpKey As String, iMeasureTechnicalName As String, iPropertyName As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetMember(iExcelInternalSheetId As <Unsupported variant type>, col As Long, row As Long, iDpKey As String, iDimensionMember As String, iDisplay As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetProperty(iPropertyName As String, iParam1 As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetSourceInfo(iDpKey As String, iPropertyName As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetUniformScaling(iExcelInternalSheetId As <Unsupported variant type>, col As Long, row As Long, iDpKey As String, iMeasureKey As String, iDimensionMembers() As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetVariable(iDpKey As String, iVarTechnicalName As String, iPropertyName As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPGetWorkbookInfo(iPropertyName As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPInsertLine(iRuleName As String, iDpKey As String, iPosition As String, iPositionBy As String, iDimensionKey As String, iDimensionMemberKey As String, iNodeType As String, iTupleMembers() As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOf(iObjectType As String, iFilter As String, iFilterBy As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfDesignRules(iDpKey As String, iRuleType As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfDimensions(iDpKey As String, iSearchIn As String, iSearch As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfDynamicFilters(iDpKey As String, iPresentation As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfEffectiveFilters(iDpKey As String, iPresentation As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfMeasureFilters(iDpKey As String, iDisplay As String, iName As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfMembers(iDpKey As String, iSelectorType As String, iName As String, iFilter As String, iFilterBy As String, iCount As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfMessages(iSeverity As String, iDetails As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfStaticFilters(iDpKey As String, iPresentation As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPListOfVariables(iDpKey As String, iPresentation As String, iShow As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPLogOff(iDoRestart As Boolean)
    Member of BiExcelBase.EaExcelFunctions

Function SAPLogon(iAlias As String, iClient As String, iUser As String, iPassword As String, iLanguage As String, iAuthenticationType As String, iSID As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPMemberId(iSourceDpKey As String, iMember As String, iDimension As String, iPresentation As String, iHierarchy As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPMemberIdFromReferenceCell(iRefSheetId As <Unsupported variant type>, iRefRow As Long, iRefCol As Long)
    Member of BiExcelBase.EaExcelFunctions

Function SAPMoveDimension(iDpKey As String, iDimensionKey As String, iAction As String, iIdentifier As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPOpenWorkbook(iTechnicalName As String, iConnectionAlias As String, iVariables() As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPSelectMember(iSourceDpKey As String, iRecogMember As String, iDimensionHint As String, iPresentation As String, iSelectorMode As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetData(iExcelInternalSheetId As <Unsupported variant type>, col As Long, row As Long, iDpKey As String, iNewValue, iOption As String, iReferenceRowIndex As Long, iReferenceColumnIndex As Long, iReferenceSheetInternalId As <Unsupported variant type>, iMeasureKey As String, iDimensionMembers() As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetFilter(iDpKey As String, iDimensioKey As String, iMember As String, iPresentation As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetFilterComponent(iSourceDpKey As String, iSourceDimensionKey As String, iSelectionType As String, iCrosstabList As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetFormat(iRuleName As String, iDpKey As String, iStyle As String, iFirstLineType As String, iFirstLineContext() As String, iSecondLineType As String, iSecondLineContext() As String, iOperationScope As String, iSettings As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetPlanParameter(iPoKey As String, iParameterKey As String, iMember As String, iPresentation As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetRefreshBehaviour(iMode As String, iMessageDisplay As String, iClearMessages As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetText(iRuleName As String, iDpKey As String, iText As String, iFirstLineType As String, iFirstLineContext() As String, iSecondLineType As String, iSecondLineContext() As String)
    Member of BiExcelBase.EaExcelFunctions

Function SAPSetVariable(iPrompt As String, iPromptValue As String, iPromptInputType As String, iDpKey As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Function SAPSuppressMessage(iMessageId As String) As Boolean
    Member of BiExcelBase.EaExcelFunctions

Sub SetLastXllError(iFunction As String, iErrorNumber As Long, iParam1 As String, iParam2 As String, iParam3 As String)
    Member of BiExcelBase.EaExcelFunctions

Many (but not all) of these functions are documented here:

https://help.sap.com/viewer/ca9c58444d64420d99d6c136a3207632/2.7.1.0/en-US/f2707ef86c9b1014bf2c9a7eb0e91070.html or https://help.sap.com/viewer/ca9c58444d64420d99d6c136a3207632/2.7.1.0/en-US/f270fd456c9b1014bf2c9a7eb0e91070.html

The SAP AO Addin object has an object property containing the SAPCof COM Object. Methods in this object are largely undocumented.

Methods in ISapCofComObject are as follows:

Function ActivatePlugin(iPluginName As String) As Boolean
    Member of CofInterfaces.ISapCofComObject

Function AddInInitialized() As Boolean
    Member of CofInterfaces.ISapCofComObject

Function GetAndActivatePlugin(iPluginName As String)
    Member of CofInterfaces.ISapCofComObject

Function GetPlugin(iPluginName As String)
    Member of CofInterfaces.ISapCofComObject

Function LaunchWithFile(iFileName As String, iOfficeIsReused As Boolean, iCallerId As String) As Long
    Member of CofInterfaces.ISapCofComObject

GetPlugin might refer to BiCofLoaderPlugin, BpfCoFPlugin and EpmCofPlugin. It's unlikely these are useful however.

Another interface defined in this object is ITraceRunnerInterop who has methods as follows:

Function GetApplicationReadyState() As Boolean
    Member of CofInterfaces.ITraceRunnerInterop

Function TriggerAddinExecution(args() As String) As Boolean
    Member of CofInterfaces.ITraceRunnerInterop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment