Delete MenuItem

A

Avi

I try to delete the "Chart" subMenu item in the "Insert" menu item on the
main menu file of Excel with the following commands

Sub DeleteIt()
MenuBars(xlWorksheet).Menus("Insert").MenuItems("Chart").Delete
End Sub

But i get "Applicatin defined error message

The procedure works fine with other menu items.

Please help...

Avi

www.avibenita.com
 
J

Jim Thomlinson

Off the top of my head I think you need "Chart..." instead of "Chart". Chart
brings up a wizard/form so it is "Chart..." (dot dot dot is Microsofts way of
saying that the button will bring up a form asking for more info) in the
menu.
 
D

Dave Peterson

This worked ok for me in xl2003 (xl97+).

Application.CommandBars("Chart Menu Bar") _
.Controls("Insert").Controls("Chart...").Delete

Are you still using xl95 (when menubars() had to be used.)
 

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