Can't hide Menu Bar

R

Robert_L_Ross

I can't get the CommandBars .visible to work. I recorded a macro while I
closed the Menu Bar, and it returned the following:
CommandBars("Menu Bar").Visible = False
msg = MsgBox("Menu Bar Hidden", vbOKOnly, "Test")
CommandBars("Menu Bar").Visible = True

When I try to play this macro back, I get an error:
Run-time error '-2147467259 (80004005)':
Method 'Visible' of object 'CommandBar' failed

Any ideas?
 
R

Robert_L_Ross

Well, I found a way around hiding the entire bar - I can hide individual
commands.

My question now is when I hide the commands then un-hide them, when I close
my document, it asks if I want to save. Is there a way I can prevent the
prompt?
 
J

Jezebel

My question now is when I hide the commands then un-hide them, when I
close
my document, it asks if I want to save. Is there a way I can prevent the
prompt?

MyDocument.Saved = true
 
K

Klaus Linke

Hi Robert,

The Menu Bar is protected against changes by default
(msoBarNoChangeVisible+msoBarNoMove, I guess), and you'd first have to set
its .Protection property to msoBarNoProtection.

Regards,
Klaus
 

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