U
u473
I tried to adapt J.Walkenbach code to add a menu item on Workbook_open
but I get the following error on "HelpIndex = CommandBars(1).Controls
("Help").Index"
Run-time Error '91'
Object variable or with block variable not set
Private Sub Workbook_Open()
Dim HelpIndex As Integer
Dim NewMenu As CommandBarPopup
' Get Index of Help menu
HelpIndex = CommandBars(1).Controls("Help").Index
' Create the control
Set NewMenu = CommandBars(1) _
.Controls.Add(Type:=msoControlPopup, Before:=HelpIndex,
Temporary:=True)
' Add a caption
NewMenu.Caption = "Fi<er"
End Sub
Help appreciated,
J.P.
but I get the following error on "HelpIndex = CommandBars(1).Controls
("Help").Index"
Run-time Error '91'
Object variable or with block variable not set
Private Sub Workbook_Open()
Dim HelpIndex As Integer
Dim NewMenu As CommandBarPopup
' Get Index of Help menu
HelpIndex = CommandBars(1).Controls("Help").Index
' Create the control
Set NewMenu = CommandBars(1) _
.Controls.Add(Type:=msoControlPopup, Before:=HelpIndex,
Temporary:=True)
' Add a caption
NewMenu.Caption = "Fi<er"
End Sub
Help appreciated,
J.P.