Hello,
You create a button and attach a macro to the button. and the code required in the macro is as follows.
sub change_context
Dim ex As New EPMAddInAutomation
AFTER_CONTEXTCHANGE = ex.SetContextMember(conname, dimname, dimvalue)
ex.RefreshActiveSheet
Endsub.
Try to explore more options of epmaddinautomation class you would get more options.
I give you some more statements which are use full to you.
conname = ex.GetActiveConnection(ActiveSheet)
dimvalue = ex.GetContextMember(conname1, dimname)
Hope you have understanding for programming.
Hope it helps,
Andrew.