Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA has deleted my Menu Bar

Status
Not open for further replies.

Brockers

Instructor
Jul 27, 2002
13
GB
A predecessor of mine who was familiar with VB, wrote a model with the following command.

Code:
Application.CommandBars("WORKSHEET MENU BAR").Controls(1).Delete

It has deleted the menu bar throughout excel and I cannot get it back. I fear I may have to re-install Excel, is there an easier way! Can you help?


Regards

Brockers
Instructor
New Horizons Manchester England
 
Hi Brockers
This is just a series of stabs in the dark....

Have you checked that the menu bar is available to you manually ie RightClick the toolbar area>Customize>scroll to bottom and see if the menu bar is there?

If it isn't try this line of code to see if it has any effect
CommandBars("WORKSHEET MENU BAR").visible = true

I haven't tried recreating your problem just incase(!) but the way the code reads is that it should delete the FILE menu and not the whole menu bar so this is just guess work at the moment.

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
maverick
I see your point! I'd assumed the whole worksheet menu bar had gone awol!!

Brockers
Bearing in mind maverickmonster's point if it is just the FILE menu missing then resetting the menu bar manually should do the trick

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Hi Brockers,

For a one-off exercise just do it manually. You can RESET the menu bar but you would lose any other tailoring done to it .. or you can just add the File menu back again.

To Reset ..

Select Tools > Customize from the Menu
Select the Toolbars Tab
Scroll down and Select Worksheet Menu Bar
Click on Reset
Answer OK to "Are you sure?"

To manually add back the File Menu ..

Select Tools > Customize from the Menu
Select the Commands Tab
Under Categories scroll down and Select Built-in Menus
From the Commands on the right, Click and Drag File to where you want it on the Menu


Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top