LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Adding a new menu on the Worksheet menu bar

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, Befo=HelpIndex,
Temporary:=True)
' Add a caption
NewMenu.Caption = "Fi&lter"
End Sub

Help appreciated,
J.P.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA:programmatically invoking menu items from Excel Worksheet menu morse100 Excel Programming 15 October 29th 10 07:29 PM
Adding a Custom menu / sub menu PaulW Excel Programming 5 April 25th 07 11:44 AM
Adding Sub Menu Item to Current Custom Menu Renato Excel Programming 2 December 19th 05 12:48 AM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM
Adding menu to the mouse right click pop-up menu Jack Excel Programming 1 February 12th 04 05:23 AM


All times are GMT +1. The time now is 07:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"