Skip to Content
0

VBA code to refresh active sheet

Feb 21 at 02:19 PM

112

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Vadim Kalinin Feb 21 at 03:45 PM
0

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
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Vadim

This is not my code. I am currently helping a client with some of the system issues they face every quarter. One of them being worksheets needing to be automatically refreshed before data can be inputted, and this was the code used to refresh the active sheet.

I will apply this code. Thanks for your input

0

Please accept the correct answer!

0
Vadim Kalinin Feb 21 at 03:39 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded