cancel
Showing results for 
Search instead for 
Did you mean: 

How to refresh specific report/sheet after changing Context member using VBA?

former_member398742
Participant
0 Kudos

Hi Everyone,

I have requirement to refresh automatically specific report/sheet after changing Context members using VBA?

This is my report and used EPMContextMember for User selection. So when user changes time then report should get refresh automatically using VBA - AFTER_CHANGECONTEXT?

NOTE : I don't want to use option " Automatic refresh on Context change" in User Options as if i select this option then all the worksheet/all the reports will get refresh.

I basically looking for refresh only report only specific report/sheet

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

"So when user changes time then report should get refresh automatically using VBA - AFTER_CHANGECONTEXT?"

The correct name of even function is AFTER_CONTEXTCHANGE

Please read EPM help 42.7 Custom VBA Functions (Events)

https://help.sap.com/viewer/ec68e48b18a44a49abb12b8ee8ae306f/10.0.28/en-US/f9b8a4b16faf1014878bae8cb...

former_member398742
Participant
0 Kudos

Hi Vadim,

Thanks for correcting me and sharing document.

I have written below code in my specificsheet but it did not work.

Function AFTER_CONTEXTCHANGE()

Dim epmobj As New FPMXLClient.EPMAddInAutomation

epmobj.RefreshActiveReport

End Function

Could you please confirm if the above is correct or not?

Thanks,

Vishu

former_member186338
Active Contributor
0 Kudos

"I have written below code in my specificsheet but it did not work." -incorrect!

You have to create new code module and put your code in this new module!