The ExecuteMenuItem method of the IOlapAddIn interface is called when the user clicks a menu item. Provide code in this method to respond to the user’s actions.
Function ExecuteMenuItem(CurrentNode As OlapTreeNode, MenuItem As OlapMenuItem) As RefreshTreeTypes
A member of the RefreshTreeTypes enumeration.
By querying the properties of the CurrentNode and MenuItem objects, your application can determine which menu item the user clicked and respond accordingly.
Private Function IOlapAddIn_ExecuteMenuItem( _
CurrentNode As DSSAddInsManager.OlapTreeNode, _
MenuItem As DSSAddInsManager.OlapMenuItem) _
As DSSAddInsManager.RefreshTreeTypes
On Error GoTo ExecuteMenuItem_Err 'Handle errors
Select Case CurrentNode.Caption
Case "Add"
Select Case MenuItem.Key
Case mnuactAddItem1
'Code to add item 1
Case mnuactAddItem2
'Code to add item 2
Case mnuactAddItem3
'Code to add item 3
End Select
Case "Edit"
Select Case MenuItem.Key
Case mnuactEditItem1
'Code to edit item 1
Case mnuactEditItem1
'Code to edit item 2
Case mnuactEditItem1
'Code to edit item 3
End Select
End Select
Exit Function
ExecuteMenuItem_Err:
MsgBox "ExecuteMenuItem Failed"
Err.Clear
End Function