on 01-23-2012 7:05 PM
Hi
I'm trying to open the context member selector pop-up window through a vba button on my excel worksheet.
I've managed to step successfully through the code, however I can't get the function to do what it's supposed to be doing? Am I missing any extra parameters i.e. what additionally should I amend to the piece of code to open up the TIME dimension context member selector through my code?
Dim EPM10 As New FPMXLClient.EPMAddInAutomation
EPM10.OpenDimensionAndMemberSelector(EPM10.GetActiveConnection(ActiveSheet))
Any help in this regard will be appreciated.
Thanks
Ryno
I'm not totally sure what the intention of OpenDimensionAndMemberSelector is.
But, I think you can probably do what you want to do with the following:
Dim ea As New EPMAddInAutomation
Dim selectd As String
selectd = ea.OpenMemberSelector(ea.GetActiveConnection(ActiveSheet), "TIME", ea.GetContextMember(ea.GetActiveConnection(ActiveSheet), "TIME"))
If InStr(1, selectd, ";") > 1 Then
ea.SetContextMember ea.GetActiveConnection(ActiveSheet), "TIME", Left(selectd, InStr(1, selectd, ";") - 1)
Else
ea.SetContextMember ea.GetActiveConnection(ActiveSheet), "TIME", selectd
End If
ea.RefreshActiveSheet
The code above brings up the member selector dialog for TIME - with the current context member selected. When you click OK, it puts the selected member(s) in the variable "selectd". If there are multiple members selected, then they are separated by ";"s. So, the code above sets the context to the first member in the selection list.
Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
3 | |
1 | |
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.