on 10-20-2019 10:27 AM
Easy! First I don't see FPMXLClient reference:
Second: simple working code:
Option Explicit
Dim epm As New FPMXLClient.EPMAddInAutomation
Public Function AFTER_CONTEXTCHANGE() As Boolean
Dim wshCurrent As Worksheet
Dim objCurrent As Object
Set wshCurrent = ThisWorkbook.ActiveSheet
If wshCurrent.Name = "Sheet1" Then
Set objCurrent = Application.Selection 'Save current selection
wshCurrent.Range(epm.GetDataTopLeftCell(wshCurrent, "000")).Select
epm.RefreshActiveReport
objCurrent.Select 'Restore current selection
End If
End Function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you prefer to use universal code working with both EPM Add-In and AO with late binding and without referencing FPMXLClient, then:
Instead of
Dim epm As New FPMXLClient.EPMAddInAutomation
Use inside your procedure:
Dim objAddIn As COMAddIn
Dim epm As Object
Dim AOComAdd As Object
Dim blnEPMInstalled As Boolean
'Universal code to get FPMXLClient for standalone EPM or AO
For Each objAddIn In Application.COMAddIns
If objAddIn.progID = "FPMXLClient.Connect" Then
Set epm = objAddIn.Object
blnEPMInstalled = True
Exit For
ElseIf objAddIn.progID = "SapExcelAddIn" Then
Set AOComAdd = objAddIn.Object
Set epm = AOComAdd.GetPlugin("com.sap.epm.FPMXLClient")
blnEPMInstalled = True
Exit For
End If
Next objAddIn
If Not blnEPMInstalled Then
MsgBox "Error! EPM not installed!"
Exit Sub
End If
epm.RefreshActiveReport ' or any other
Sample in my blog: https://blogs.sap.com/2019/06/24/bpc-nw-10-vba-function-to-get-bassomeparent-dimension-members-list/
Thank you issue resolved...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.