Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Menu separator

16 views
Skip to first unread message

Myrna Larson

unread,
Oct 4, 1999, 3:00:00 AM10/4/99
to
On 5 Oct 1999 03:31:32 GMT, "Kaz Babiarz" <babi...@microlab.com> wrote:

>I'm creating a menu from VBA program. But I can't find any info in Excel
>Help how to insert a menu separator. Any idea?

Check out the BeginGroup property. Setttig it to True adds the divider line.


Kaz Babiarz

unread,
Oct 5, 1999, 3:00:00 AM10/5/99
to

Vic Eldridge

unread,
Oct 5, 1999, 3:00:00 AM10/5/99
to
CommandBars("YourCommandBar").Controls("YourControl").BeginGroup = True


Kaz Babiarz <babi...@microlab.com> wrote in message
news:01bf0eed$3fafff40$846da7d1@default...

Perry de Lima

unread,
Oct 5, 1999, 3:00:00 AM10/5/99
to
Hi Kaz,
While having set the menu controls properly:
Set the 'BeginGroup' property to True

Example of adding a new menu-item to Excel's built in
Worksheet menubar:


Dim CBar As CommandBar
Dim MyMenu As Object
Set CBar = CommandBars("Worksheet Menu Bar")

'->Add new menu item to the worksheet menubar
With CBar.Controls
Set MyMenu = .Add(Type:=msoControlPopup, temporary:=True)
MyMenu.Caption = "&My Bar"
End With

'-> Add new submenu-item- note: New group
With CBar.Controls("&My Bar").Controls
Set MyMenu = .Add(Type:=msoControlButton, temporary:=True)
MyMenu.Caption = "My &Item"
MyMenu.BeginGroup = True
End With

Play around with the above example ...
HTH
Perry de Lima

Patrick Molloy

unread,
Oct 6, 1999, 3:00:00 AM10/6/99
to
here's a bit of my code:

Dim mnbNew As Menu

Set mnbNew = MenuBars(xlWorksheet).Menus.Add("&Options")
mnbNew.MenuItems.Add "Run &Utility", "Show_Form"
mnbNew.MenuItems.Add "-"

the last line will add a 'separator' line - just add more menu items
after this


On Mon, 04 Oct 1999 23:46:47 -0500, Myrna Larson
<myrna...@home.net> wrote:

>On 5 Oct 1999 03:31:32 GMT, "Kaz Babiarz" <babi...@microlab.com> wrote:
>
>>I'm creating a menu from VBA program. But I can't find any info in Excel
>>Help how to insert a menu separator. Any idea?
>

0 new messages