Lee
With .Add(msoControlButton)
.Caption = "Med/Dental Tally"
With .Controls
With .Add(msoControlButton)
You're adding an msoControlButton and trying to add controls to it. You
can't. The first With .Add needs to be msoControlPopup.
--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.
"Lee" wrote in message
...
This is the code I'm currently using:
On Error Resume Next
With Application.CommandBars("worksheet menu bar").Controls
("Tally")
With .Controls
With .Add(msoControlPopup)
.Caption = "Select Tally"
With .Controls
With .Add(msoControlButton)
.Caption = "Med/Dental Tally"
With .Controls
With .Add(msoControlButton)
.Caption = "Format Tally"
.OnAction = "FormatTally"
End With
With .Add(msoControlButton)
.Caption = "Add Tally Formulas"
.OnAction = "MakeFormulas"
End With
End With
End With
With .Add(msoControlButton)
.Caption = "Rx Tally"
With .Controls
With .Add(msoControlButton)
.Caption = "Format Rx Tally"
.OnAction = "rxFormattally"
End With
End With
End With
I modified this from an earlier menu I was using. I've
added another code module to my application, and I want to
use menus to allow my users to select the type of tally
(either Med/Dental Tally or Rx Tally) that they need to
create. What is currently happening is that a "Tally"
menu is created, the first level shows "Select Tally", and
then a submenu that shows "Med/Dental Tally" and "Rx
Tally", but nothing beyond that point. Once I can get
these commands working, I plan to add more commands under
each type of tally.
Thanks, Lee
-----Original Message-----
Lee,
I don't know of any hard and fast limit, and if there is
such a limitation,
it is definitely greater than two levels. Are you
creating the menus with
code? What code are you using?
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Lee" wrote in
message
...
How many levels can a custom menu have? I currently
have
a menu that has two levels or popups, but I can't get it
to extend further than two. I didn't know if that was
because I'm doing it wrong or if there is a limit.
.