Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Adding menu items

I've tried a number of different examples with no luck, so I tried
cutting the examples down to the minimum amount of code needed to add an
item to the menu bar. This is what I came up with:

Sub new_menu()
Dim cbmDemoMenu As CommandBarPopup

On Error Resume Next
Application.CommandBars("Menu Bar") _
.Controls("DEMO").Delete
Set cbmDemoMenu = Application.CommandBars("Menu Bar") _
.Controls.Add(msoControlPopup, "DEMO", , 3, True)
End Sub

I had no luck. I've searched the board, and microsoft's site. Both had
great examples, but ended in invalid procedure calls.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Adding menu items

Is "Menu Bar" your own customized toolbar?

If no, then maybe:

Option Explicit

Sub new_menu()
Dim cbmDemoMenu As CommandBarPopup
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar") _
.Controls("DEMO").Delete
On Error GoTo 0
Set cbmDemoMenu = Application.CommandBars("worksheet Menu Bar") _
.Controls.Add(Type:=msoControlPopup, temporary:=True)
cbmDemoMenu.Caption = "DEMO"
End Sub

Claud Balls wrote:

I've tried a number of different examples with no luck, so I tried
cutting the examples down to the minimum amount of code needed to add an
item to the menu bar. This is what I came up with:

Sub new_menu()
Dim cbmDemoMenu As CommandBarPopup

On Error Resume Next
Application.CommandBars("Menu Bar") _
.Controls("DEMO").Delete
Set cbmDemoMenu = Application.CommandBars("Menu Bar") _
.Controls.Add(msoControlPopup, "DEMO", , 3, True)
End Sub

I had no luck. I've searched the board, and microsoft's site. Both had
great examples, but ended in invalid procedure calls.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Adding menu items

Thank you! That worked.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
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
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
adding shortcut menu items singincpa[_2_] Excel Programming 2 October 29th 04 07:36 PM
adding shortcut menu items singincpa Excel Programming 2 October 29th 04 03:24 PM
Adding Items to a ListBox-Unique Items Only jpendegraft[_14_] Excel Programming 2 May 2nd 04 02:27 AM
Adding and Removing Custom Menu Items for one file... Jon Kane Excel Programming 2 September 17th 03 07:23 PM


All times are GMT +1. The time now is 04:51 PM.

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

About Us

"It's about Microsoft Excel"