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: 5
Default Adding Separator Menu Item - Excel 2003

Anyone know how to dynamically add a separator menu item to a custom menu in
Excel 2003?
This code works with the exception that instead of creating a separator menu
item, it simply creates another
menu item with caption "-". Is it possible to get there from here?

TIA

Des
__________________________________________________ _______


Sub test()

Dim ComBar As CommandBar
Dim PopMain As CommandBarPopup
Dim PopAbout As CommandBarButton
Dim PopDivider As CommandBarButton


For Each ComBar In CommandBars
If ComBar.Name = "Worksheet Menu Bar" Then
Set PopMain = ComBar.Controls.Add(msoControlPopup, , ,
(ComBar.Controls.Count - 1), True)
PopMain.Caption = "Custom Menu Name Here"
Exit For
End If
Next

If PopAbout Is Nothing Then
Set PopAbout = PopMain.Controls.Add(msoControlButton, , , , True)
PopAbout.Caption = "&About..."
End If


If PopDivider Is Nothing Then
Set PopDivider = PopMain.Controls.Add(msoControlButton, , , , True)
PopDivider.Caption = "-"
End If

yadda, yadda, yadda...



 
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
Adding a menu item to Excel Uzi Barzilai Excel Discussion (Misc queries) 1 January 14th 08 10:25 AM
How do we add a separator in Excel 2007 menu using VBA Suman Excel Discussion (Misc queries) 6 December 19th 06 06:54 AM
Adding a Menu Item into a sheet as a button [email protected] Excel Programming 3 March 23rd 05 06:37 PM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM
add separator bar to right-click menu Rob Bovey Excel Programming 0 July 13th 03 10:17 PM


All times are GMT +1. The time now is 08:37 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"