Command Bar with Number in Name

M

Matt Jensen

My app is (unfortunately (for cell reference reasons)) named the A10
Checklist. I've created a menu bar for it which loads fine etc., unless I
try to call the tool/command bar A10 Checklist. if I take out the 10 it
works fine. i.e..

Dim objA10Bar As CommandBar
Set objA10Bar = CommandBars.Add(Name:="A10 Checklist",
Position:=msoBarFloating, Temporary:=True)

the above does not work, whereas

Dim objA10Bar As CommandBar
Set objA10Bar = CommandBars.Add(Name:="A Checklist",
Position:=msoBarFloating, Temporary:=True)

works fine. How can I add a number into the toolbar name?
Thanks
Matt
 
B

Bob Phillips

Matt,

Not what you want to hear, but it loaded fine for (XL2000, XP Pro).

Do you get an error, or just no toolbar (you do make it visible don't
you?).?

--

HTH

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

Matt Jensen

Hmm, maybe my method of elimination was incorrect.
I'm on Excel 2002, XP Pro
And yes, I do make it visible
Cheers
Matt
 
T

Tom Ogilvy

Excel 2002:

Sub AddToolbar()
Dim objA10Bar As CommandBar
On Error Resume Next
CommandBars("A10 Checklist").Delete
On Error GoTo 0
Set objA10Bar = CommandBars.Add(Name:="A10 Checklist", _
Position:=msoBarFloating, Temporary:=True)
objA10Bar.Visible = True
End Sub


Worked fine for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top