Skip to Content

VBA code to refresh active sheet

Hi

I have an issue with BPC 10.1 standard, EPM Add-in. I am trying to write a VB code to refresh the data when I click on the worksheet. I have this code below but it can be unreliable. Any suggestions?

Sub Report4()
Sheets("Report4").Select
Application.Run "EPMExecuteAPI", "RefreshActiveSheet"
End Sub

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 21 at 03:45 PM

    I recommend to use universal code (standalone EPM or EPM in AO) from the note: https://launchpad.support.sap.com/#/notes/2451876

    Public Sub RefreshSheet()
    Dim API As Object
    Dim epmCOm As Object
    On Error Resume Next
    Set API = Application.COMAddIns("FPMXLClient.Connect").Object
    If Err.Number <> 0 Then
    Set epmCOm = Application.COMAddIns("SapExcelAddIn").Object
    Set API = epmCOm.GetPlugin("com.sap.epm.FPMXLClient")
    End If
    API.RefreshActiveSheet
    On Error GoTo 0
    End Sub
    Add comment
    10|10000 characters needed characters exceeded

  • Feb 21 at 03:39 PM

    Sorry, but where did you found this code? Have read EPM help????

    Add comment
    10|10000 characters needed characters exceeded