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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Worksheet Menu Bar command bar not reactivating

Status
Not open for further replies.

chuckschilling

Programmer
Aug 7, 2003
5
US
Hi all! I'm developing an Excel worksheet to act as something of a custom control and in so doing am disabling all command bars and then re-enabling them using the
following code in the workbook Open event:

For Each menuOption In Application.CommandBars
'Suppress all the command bars
menuOption.Enabled = False
Next

This works just fine in disabling all of the Excel command bars.

I use the following code to re-enable the command bars in the Deactivate event of the Workbook:

For Each menuOption In Application.CommandBars
'Re-enable the command bars
menuOption.Enabled = True
Next

All of the command bars are re-enabled, with the exception of the main Excel command bar ("Worksheet Menu Bar"). I've tried enabling it explicitly, to no avail, and have also tried the enabling method in the BeforeClose event of the workbook, which also does not work.

When I use the exact same code in a control in a different workbook, it works just fine. Am I missing something? Is there something special about the Worksheet Menu Bar control that I just don't get?
 
Hi Chuck,

Check out this Thread, it might help you out in another way.

thread68-627995

I hope this helps you out.



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top