cancel
Showing results for 
Search instead for 
Did you mean: 

EPM API

0 Kudos

Hi Expert,

I can't seem to get some API work and wondering if I'm doing anything wrong.

GetActiveConnection and GetColumnAxisMembers both return strings, and I could show the string result of the first API in the message box while failed on the second.  Any idea?  The vba codes are:

Dim api as New EPMAddInAutomation

str = api.GetActiveConnection(Worksheets("Report"))

MsgBox str

==> This will correctly return the Connection Name in the message box

str = api.GetColumnAxisMembers(Worksheets("Report"), "000")

MsgBox str

==> this will prompt an error: Compile Error, Type mismatch.

Thanks in advance,

Ben

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor

Hi Ben,

GetColumnAxisMembers returns not a string, but array of strings!

Dim api as New EPMAddInAutomation

Dim strMembers() as String 'declaration of variable

Dim lngTemp as Long

strMembers = api.GetColumnAxisMembers(Worksheets("Report"), "000")

For lngTemp = 0 To UBound(strMembers)

    MsgBox strMembers(lngTemp)

Next lngTemp

You can combine array to string with Join function if you want.

strAll = Join(strMembers, ",")

Vadim

0 Kudos

Thanks Vadim.  This is really helpful!

Answers (0)