ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete MenuItem (https://www.excelbanter.com/excel-programming/343819-delete-menuitem.html)

avi

Delete MenuItem
 
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("C hart").Delete
End Sub

But i get "Applicatin defined error message

The procedure works fine with other menu items.

Please help...

Avi

www.avibenita.com



Jim Thomlinson[_4_]

Delete MenuItem
 
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.
--
HTH...

Jim Thomlinson


"Avi" wrote:

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("C hart").Delete
End Sub

But i get "Applicatin defined error message

The procedure works fine with other menu items.

Please help...

Avi

www.avibenita.com




Dave Peterson

Delete MenuItem
 
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.)



Avi wrote:

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("C hart").Delete
End Sub

But i get "Applicatin defined error message

The procedure works fine with other menu items.

Please help...

Avi

www.avibenita.com


--

Dave Peterson

avi

Delete MenuItem
 
Thanks so much
Works perfectly!!!!!!!!!!!


Avi Benita 054-4660641 wwwAvi Benita 054-4660641 www.avibenita.com
"Jim Thomlinson" wrote in message
...
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.
--
HTH...

Jim Thomlinson


"Avi" wrote:

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("C hart").Delete
End Sub

But i get "Applicatin defined error message

The procedure works fine with other menu items.

Please help...

Avi

www.avibenita.com







All times are GMT +1. The time now is 10:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com