Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add submenu Items

I've been using the following code to enter custom menu
items in a template.

Sub AddMenuItem()
Dim Item As CommandBarControl
Set Item = CommandBars(1).Controls("Budgeting") _
.Controls.Add
Item.Caption = "&January"
Item.BeginGroup = True
End Sub

This works fine. I need to add a submenu item to the
custom menu. so when click january other submenus pop
up. I was look at the help file for VBA, but am unable
to locate this specific topic.
Any help would be greatly appreciated.

Renato
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Add submenu Items

Sub AddMenuItem()
Dim Item As CommandBarControl
Set Item = CommandBars(1).Controls("Budgeting") _
.Controls.Add(type:=msoControlPopup)
with Item
.Caption = "&January"
.BeginGroup = True
Set subItem = .Controls.Add(Type:=msoControlButton)
With subItem
.Caption = "Day1"
End With
Set subItem = .Controls.Add(Type:=msoControlButton)
With subItem
.Caption = "Day2"
End With
'etc.
End With
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Renato" wrote in message
...
I've been using the following code to enter custom menu
items in a template.

Sub AddMenuItem()
Dim Item As CommandBarControl
Set Item = CommandBars(1).Controls("Budgeting") _
.Controls.Add
Item.Caption = "&January"
Item.BeginGroup = True
End Sub

This works fine. I need to add a submenu item to the
custom menu. so when click january other submenus pop
up. I was look at the help file for VBA, but am unable
to locate this specific topic.
Any help would be greatly appreciated.

Renato



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Add submenu Items

thanks a lot.
I appreciate you help.
Renato
-----Original Message-----
Sub AddMenuItem()
Dim Item As CommandBarControl
Set Item = CommandBars(1).Controls("Budgeting") _
.Controls.Add(type:=msoControlPopup)
with Item
.Caption = "&January"
.BeginGroup = True
Set subItem = .Controls.Add

(Type:=msoControlButton)
With subItem
.Caption = "Day1"
End With
Set subItem = .Controls.Add

(Type:=msoControlButton)
With subItem
.Caption = "Day2"
End With
'etc.
End With
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Renato" wrote in

message
...
I've been using the following code to enter custom menu
items in a template.

Sub AddMenuItem()
Dim Item As CommandBarControl
Set Item = CommandBars(1).Controls("Budgeting") _
.Controls.Add
Item.Caption = "&January"
Item.BeginGroup = True
End Sub

This works fine. I need to add a submenu item to the
custom menu. so when click january other submenus pop
up. I was look at the help file for VBA, but am unable
to locate this specific topic.
Any help would be greatly appreciated.

Renato



.

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
Add XML submenu m.sparks[_2_] Excel Discussion (Misc queries) 3 June 12th 07 11:57 PM
How to add a submenu to a submenu? tan New Users to Excel 6 October 4th 06 09:17 AM
XML submenu SC Excel Discussion (Misc queries) 1 April 19th 06 09:57 PM
Findcontrol for submenu item? Doug Glancy Excel Programming 2 November 30th 04 06:00 AM
Creating a SubMenu Rockee052[_38_] Excel Programming 3 February 16th 04 04:24 AM


All times are GMT +1. The time now is 11:18 AM.

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"