Attribute VB_Name = "mod_WhatsThis" Option Compare Database Option Explicit 'Use with the Microsoft Public Sub WhatsThisMenuRemove() Dim cbr As Object 'CommandBar ' Dim ctrl As Object 'CommandBarButton ' Dim intIndex As Integer On Error GoTo ProcError For Each cbr In Application.CommandBars intIndex = cbr.Controls("What's This Menu").Index If intIndex <> 0 Then cbr.Controls("What's This Menu").Delete End If ProcNext: Next ProcExit: Exit Sub ProcError: Select Case Err.Number Case -2147467259 'ignore Case 5 'does not exist in this commandbar intIndex = 0 Resume Next Case Else Debug.Print cbr.Name, Err.Number, Err.Description End Select Resume ProcNext End Sub Public Sub WhatsThisMenuAdd() Dim cbr As CommandBar 'Object ' Dim ctrl As CommandBarButton 'Object ' Dim intIndex As Integer On Error GoTo ProcError For Each cbr In Application.CommandBars 'don't add the "What's new control to the dfcbt_xxx commandbars If Left(cbr.Name, 5) <> "dfcbt" Then intIndex = cbr.Controls("What's This Menu").Index If intIndex = 0 Then Set ctrl = cbr.Controls.Add(1, , cbr.Name, , True) ctrl.Caption = "What's This Menu" ctrl.BeginGroup = True ctrl.OnAction = "=WhatsThisMenu()" ctrl.Visible = True ctrl.Enabled = True End If End If ProcNext: Next ProcExit: Exit Sub ProcError: Select Case Err.Number Case -2147467259 'ignore Case 5 intIndex = 0 Resume Next Case Else Debug.Print cbr.Name, Err.Number, Err.Description End Select Resume ProcNext End Sub Public Function WhatsThisMenu() Debug.Print "Name : " & CommandBars.ActionControl.Parent.Name Debug.Print "Index: " & CommandBars.ActionControl.Parent.Index MsgBox CommandBars.ActionControl.Parent.Name & vbCrLf & "Index: " & CommandBars.ActionControl.Parent.Index End Function