cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Macro for refreshing EPM report

0 Likes
4,977

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?

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

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/f9b3df686faf1014878bae8cb...

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")
Former Member
0 Likes
Sub Example()
Dim cofCom As Object
Set cofCom = Application.COMAddIns("SapExcelAddIn").Object
Dim api As Object
Set api = cofCom.GetPlugin("com.sap.epm.FPMXLClient")
api.RefreshActiveSheet
End Sub

hi vadim kalinin please help me

my requirement is refresh the current sheet

but i am getting run time error 9 and script out of range in tool->reference which one i want to select thanks in advance

former_member186338
Active Contributor
0 Likes
6309139219

I am not answering in the old questions and do not support users commenting in the old posts.

Ask a new question, please.

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Likes

Strange code 🙂

Why:

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

??

Please provide your EPM SP

0 Likes

Can't say why for sure... because it worked! Unfortunately not anymore.

EPM version 2.4.3369599

Part of Analysis Office client 2.4

Thank you for your assistance.