Skip to main content
Sep 15, 2020 8:23 AM UTC

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

Sep 15, 2020 10:34 PM UTC
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