Skip to Content
0
Feb 05, 2021 at 10:56 AM

SP 38 - Excel EPM Add-in api not working

183 Views

After updating EPM add-in for excel from sp 28 to sp 38 some synthax in macro vba have been modified.

For example, the old connection way was:

Set ea= CreateObject("FPMXLClient.EPMAddInAutomation")

But it is not working in the new version, so we changed it to the below and it works fine :

Set ea= Application.COMAddIns("FPMXLClient.Connect").Object

ea.Connect "server", "username", "password"

So in our project, we call the Excel vba function from a batch file (through vbscript file)

The problem now is the setContextMember is not changing when we run the project, below the code:

We tried many ways:

  • first method:

Set ea= Application.COMAddIns("FPMXLClient.Connect").Object

ea.Connect "server", "username", "password"

ea.SetContextMember ea.GetActiveConnection(ActiveWorkbook.ActiveSheet), "Entity", entity

  • second method:

Set ea= Application.COMAddIns("FPMXLClient.Connect").Object

ea.Connect "server", "username", "password"

Set epmobj = CreateObject("FPMXLClient.EPMAddInAutomation")

epmobj .SetContextMember ea.GetActiveConnection(ActiveWorkbook.ActiveSheet), "Entity", entity

  • thirdmethod:

Set ea= Application.COMAddIns("FPMXLClient.Connect").Object

ea.Connect "server", "username", "password"

Set epmobj = CreateObject("FPMXLClient.EPMAddInAutomation")

epmobj .SetContextMember epmobj .GetActiveConnection(ActiveWorkbook.ActiveSheet), "Entity", entity

The connection works, but the chango context did not.

Can we have some help?