Dim as CommandBar Does not Work

G

Guest

Hi there,

I'm trying to add a new menubar with menu items and i was trying to use one
of the procedures that I found in Excel 2002 VBA but it does not seem to work
for some reason. In that procedure you should define one of your variables
as command bar:

dim xxx as CommandBar

And for some reason it does not seem to work with me, VBA does not seem to
recognize the CommandBar type of objects.

Does this mean that I have incomplete installation of VBA or there is a bug
with Office 2003 that I'm using. Or, microsofy has deleted CommandBar type
of objects from its VBA code.

Can anybody help me with that.

Regards
 
T

Tom Ogilvy

correction - I forgot to use the vbModeless argument


Userform1.show vbModeless
Application.Wait(Now + TimeValue("0:00:10"))
Unload Userform1
 
B

Bernie Deitrick

Omar,

The commandbars are part of the Microsoft Office ? Object Library.

In the VBE, use Tools | References.... and put a check next oto Microsoft
Office ? Object Library. The ? will be 11 for Office 2003, IIRC.

HTH,
Bernie
MS Excel MVP
 
G

Guest

Tom,

I think your talking to the wrong guy, what you're saying has nothing to do
with my problem.

Regards,
 
G

Guest

Now it works perfectly, Thanks

But i don't know why would microsoft makes the default installation without
that thing clicked - do you know why?
 
T

Tom Ogilvy

Yes, my mistake.

--
Regards,
Tom Ogilvy

Tom Ogilvy said:
correction - I forgot to use the vbModeless argument


Userform1.show vbModeless
Application.Wait(Now + TimeValue("0:00:10"))
Unload Userform1
 
T

Tom Ogilvy

References are associated with the workbook in which they are stored. But
for every version of Excel that I have worked with, the default is for it to
be selected.
 

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