Worksheet Menu Bar

L

LAF

I work on an application where when the tool is launched a new menu ite
is added, the Data menu item is removed, and some of the sub-menu item
from the other menu items are removed. For example, we use cod
similar to the following to hide a menu item when the tool i
launched:
CommandBars(1).FindControl(ID:=30003).CommandBar.FindControl(ID:=30020).Visibl
= False

We have some users that have customized their menu bar, so that the
have other items on there other than the normal File, Edit, View, etc.
When our tool is opened, their menu items that they've added are stil
there on the menu bar. When they close our application, any new men
items that they had added to the menu bar are now gone. In th
Workbook_beforeclose routine, we do the following:

Application.CommandBars(1).Reset
Call MyShowMenuItems

The MyShowMenuItems restores the submenuitems using commands like th
following:
Application.Workbooks("wwgpe.xls").CommandBars(1).FindControl(ID:=30003).CommandBar.FindControl(ID:=478).Visibl
= True

I thought the commandbars.reset was removing the customized user men
items, so I commented that line out. After making that change an
closing the application, I found that the customized user menu ite
problem is fixed and they remain on the menu bar. However, the submen
items that aren't available in the tool still are not available when th
tool is closed.

Any suggestions
 
R

Ron de Bruin

Hi LAF

Don't use the reset line.
Restore the items you disable in the before close
Application.Workbooks("wwgpe.xls").CommandBars(1).FindControl(ID:=30003).CommandBar.FindControl(ID:=478).Visible
= True

Remove this part and try again
Workbooks("wwgpe.xls").
 

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