Forum Discussion

OSAdmin's avatar
OSAdmin
Valued Contributor II
5 years ago

How to call OS XF Excel functions from VisualBasic

Originally posted by Darryl Gerrow

Does anyone have an example of how to use VisualBasic in Excel to call the OneStream XF functions, specifically the "Refresh Workbook" and/or "Submit Workbook" API functions?

 

Thanks,

1 Reply

  • OSAdmin's avatar
    OSAdmin
    Valued Contributor II
    Originally posted by Phil Brosnan

    Hi Darryl,

    Something like this has worked for us to refresh formulas:

    Sub RefreshOnestream()

    Dim xfAddIn As COMAddIn
    Set xfAddIn = Application.COMAddIns("OneStreamExcelAddIn")

    If Not xfAddIn Is Nothing Then
      If Not xfAddIn.Object Is Nothing Then
        Call xfAddIn.Object.RefreshXFFunctions
      End If
    End If

    End Sub

    There is also a knowledgebase article that lists all of the refreshes that can be called (Cube Views, Quick Views, and Formulas, for both one sheet or all sheets). The knowledgebase article is KB0010071