on 10-23-2014 5:05 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
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.