on ‎2016 Sep 13 9:30 PM
Hi,
Our user wants a custom button, upon clicking pop-up should allow them to select & insert members as we do by Right click->EPM->Insert Members. I am successful till the pop-up and selecting single member, but when I select multiple members, it is still showing up only 1 member. Adding to this, I have to add filter also to restrict the user to select particular items only(as we do in "Member Insertion Filtering"). Please suggest me how to solve this issue. Thanks in advance.
Note : I have used the code mentioned in this thread but am I missing anything:
Request clarification before answering.
Please show your code!
And please explain, how do you want to "insert" member...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
Thanks for the response.
Please have a look at the below pic for reference. When the user clicks on "Select Object", Insert members window should pop-up where the user inserts 1 member, then Months & comments, then submits the data. Next, he'll add another member & so on. Here, one more catch is, the code which I have written for Text-fields(Months & comments) applies specific to 1st line item only (cells G31 & K31). The code is below pic. Please guide me.
Thanks,
Sandeep
'Member-Insertion pop-up :
Private Sub Cmdbutton_cost_Click()
Dim EPM As New EPMAddInAutomation
Dim selection As String
selection = EPM.OpenMemberSelector(EPM.GetActiveConnection(ActiveSheet), "COSTCATALOG", EPM.GetContextMember(EPM.GetActiveConnection(ActiveSheet), "COSTCATALOG"))
If InStr(1, selection, ";") > 1 Then
EPM.SetContextMember EPM.GetActiveConnection(ActiveSheet), "COSTCATALOG", Left(selection, InStr(1, selection, ";") - 1)
Else
EPM.SetContextMember EPM.GetActiveConnection(ActiveSheet), "COSTCATALOG", selection
End If
EPM.RefreshActiveSheet
End Sub
'Submit data :
Private Sub cmdbutton_submit_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Fax")
iColumn = ws.Cells.Find(what:="*", searchorder:=xlColumns, _
searchdirection:=xlPrevious, LookIn:=xlValues).Column + 20
If Trim(Me.TextBox_Months.Value) = "" Then
Me.TextBox_Months.SetFocus
MsgBox "Please complete the form"
Exit Sub
End If
ws.Cells(iColumn, 7).Value = Me.TextBox_Months.Value
Me.TextBox_Months.Value = ""
Me.TextBox_Months.SetFocus
If Trim(Me.TextBox_comments.Text) = "" Then
Me.TextBox_comments.SetFocus
Exit Sub
End If
ws.Cells(iColumn, 11).Value = Me.TextBox_comments.Text
Me.TextBox_comments.Text = ""
Me.TextBox_comments.SetFocus
Call Save
End Sub
'Close form(dialog-box)
Private Sub Cmdbutton_close_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Sub Save()
Dim EPM As New FPMXLClient.EPMAddInAutomation
EPM.SaveAndRefreshWorksheetData
End Sub
Hi Vadim,
Sorry, I m pretty bad at coding part(macros) . I have even tried using the below code, but I know I am wrong. Could you please correct it as this is very important & urgent to me.
Sub Add()
Dim selection As String
selection = epm.OpenMemberSelector(epm.GetActiveConnection(ActiveSheet), "COSTCATALOG", epm.AddMemberToRowAxis(epm.GetActiveConnection(ActiveSheet), "COSTCATALOG"))
If InStr(1, selection, ";") > 1 Then
epm.AddMemberToRowAxis epm.GetActiveConnection(ActiveSheet), "COSTCATALOG", Left(selection, InStr(1, selection, ";") - 1)
Else
epm.AddMemberToRowAxis epm.GetActiveConnection(ActiveSheet), "COSTCATALOG", selection
End If
epm.RefreshActiveSheet
End Sub
| User | Count |
|---|---|
| 40 | |
| 9 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.