The Disabled property of an OlapMenuItem object determines whether the menu item is enabled or disabled.
This property determines the visible state of the tree node menu item. If disabled, the menu item appears dimmed.
Private Function IOlapAddIn_ExecuteMenuItem( _
CurrentNode As DSSAddInsManager.IOlapTreeNode, _
MenuItem As DSSAddInsManager.IOlapmenuItem) _
As DSSAddInsManager.RefreshTreeTypes
On Error GoTo ExecuteMenuItem_Err 'Handle errors
'Some more code
If MenuItem.Disabled = TRUE Then
MsgBox "Disabled: Cannot execute at this time"
End If
Exit Function
ExecuteMenuItem_Err:
MsgBox "ExecuteMenuItem failed"
Err.Clear
End Function