Worksheet Menu Bar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Opened an Excel 97 file with Excel 2000. Old file had an auto_open procedure which apparently hides the main worksheet commandbar. Now can't reopen this old file to read the code. It somehow became corrupted. Cannot get this commandbar to become visible with code 'Application.Commandbars(1).Visible = True'. Reinstalled Excel 2000 and commandbar still will not respond. Looped through entire commandbar collection and this bar appears at the top of the list. Anybody got any ideas
Thanks, Gene Walker
 
Gene

Try this in the Immediate Window

Application.CommandBars("Worksheet Menu Bar").Enabled = True

Gord Dibben Excel MVP
 
I've always used CommandBars.ActiveMenuBar

Which is better?


--
Rob van Gelder - http://www.vangelder.co.nz/excel


Gord Dibben said:
Gene

Try this in the Immediate Window

Application.CommandBars("Worksheet Menu Bar").Enabled = True

Gord Dibben Excel MVP
procedure which apparently hides the main worksheet commandbar. Now can't
reopen this old file to read the code. It somehow became corrupted. Cannot
get this commandbar to become visible with code
'Application.Commandbars(1).Visible = True'. Reinstalled Excel 2000 and
commandbar still will not respond. Looped through entire commandbar
collection and this bar appears at the top of the list. Anybody got any
ideas?
 
Gene,

I think you have your answer in that it is the enabled property that you
want, not the visible property. FYI When you loop through the collection,
you can always test the name print out the index

For Each cb In Application.CommandBars
If cb.Name = "Worksheet Menu Bar" Then
Debug.Print cb.Index
Exit For
End If
Next cb

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Gene said:
Opened an Excel 97 file with Excel 2000. Old file had an auto_open
procedure which apparently hides the main worksheet commandbar. Now can't
reopen this old file to read the code. It somehow became corrupted. Cannot
get this commandbar to become visible with code
'Application.Commandbars(1).Visible = True'. Reinstalled Excel 2000 and
commandbar still will not respond. Looped through entire commandbar
collection and this bar appears at the top of the list. Anybody got any
ideas?
 
Hi Rob:

I would think the explicit solution is less ambiguous. For example, I
believe the ActiveMenuBar property returns the chart menu bar when a chart
is active.

Regards,

Vasant.
 
You're correct about the menu when a Chart is active.

That in itself is reason enough for me to change.
 

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

Back
Top