Skip to Content

Macro for refreshing EPM report

Had a button in one of my EPM reports that used to refresh the EPM report, but it not longer works. Error is "Run-time error '9': Subscript out of range.

VBA is:

Sub REFRESH()

Dim api As Object
Set api = Application.COMAddIns("FPMXLClient.Connect").Object
api.RefreshActiveWorkBook
Application.Run "EPMExecuteAPI", "RefreshActiveWorkbook"

End Sub

Why would this no longer work?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 24, 2017 at 03:59 PM

    Your issues are related to the migration to AO 2.4.

    VBA code for AO is different then the code for standalone EPM.

    Please read help:

    https://help.sap.com/viewer/46f83019d80d4a0787baa7e49f3f95af/2.6.0.0/en-US/f9b3df686faf1014878bae8cb0e91070.html

    Sample of VBA is here!

    Dim cofCom As Object
    Set cofCom = Application.COMAddIns("SapExcelAddIn").Object
    
    Dim api As Object
    Set api = cofCom.GetPlugin("com.sap.epm.FPMXLClient")
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 21, 2017 at 08:51 PM

    Strange code :)

    Why:

    api.RefreshActiveWorkBook
    Application.Run "EPMExecuteAPI", "RefreshActiveWorkbook"

    ??

    Please provide your EPM SP

    Add comment
    10|10000 characters needed characters exceeded