Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Deleting Menu

Hello:

I added a new custom menu

using the follwing the code

Sub CreateMenu()
Dim DataMenu As CommandBarPopup
Dim NewMenuItem As CommandBarButton


Set DataMenu = CommandBars(1).FindControl(ID:=30011)

Set NewMenuItem = DataMenu.Controls.Add _
(Type:=msoControlButton)
With NewMenuItem
.Caption = "&eeprom"
.OnAction = "emc"
.BeginGroup = True
End With

End Sub

Sub emc()
UserFormEMC.Show
End Sub

This works and added a menu eeprom in main menu data.

I am not able to delete the menu eeprom ? How do I do that?

Thanks in advance

Ravi


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Deleting Menu

Sub DeleteIt()
Dim DataMenu As CommandBarPopup
Set DataMenu = CommandBars(1).FindControl(ID:=30011)
On Error Resume Next
DataMenu.Controls("&eeprom").Delete
End Sub


--
Jim
"ravi" wrote in message
...
| Hello:
|
| I added a new custom menu
|
| using the follwing the code
|
| Sub CreateMenu()
| Dim DataMenu As CommandBarPopup
| Dim NewMenuItem As CommandBarButton
|
|
| Set DataMenu = CommandBars(1).FindControl(ID:=30011)
|
| Set NewMenuItem = DataMenu.Controls.Add _
| (Type:=msoControlButton)
| With NewMenuItem
| .Caption = "&eeprom"
| .OnAction = "emc"
| .BeginGroup = True
| End With
|
| End Sub
|
| Sub emc()
| UserFormEMC.Show
| End Sub
|
| This works and added a menu eeprom in main menu data.
|
| I am not able to delete the menu eeprom ? How do I do that?
|
| Thanks in advance
|
| Ravi
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Deleting Menu

Also good info here

http://support.microsoft.com/default...02&Product=xlw
How to customize menus and menu bars in Excel

http://www.j-walk.com/ss/excel/tips/tip53.htm
Creating Custom Menus (John Walkenbach) TIP

http://www.erlandsendata.no/english/...oadcommandbars
Ole P. Erlandsen's Web Site (Example workbooks)


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jim Rech" wrote in message ...
Sub DeleteIt()
Dim DataMenu As CommandBarPopup
Set DataMenu = CommandBars(1).FindControl(ID:=30011)
On Error Resume Next
DataMenu.Controls("&eeprom").Delete
End Sub


--
Jim
"ravi" wrote in message
...
| Hello:
|
| I added a new custom menu
|
| using the follwing the code
|
| Sub CreateMenu()
| Dim DataMenu As CommandBarPopup
| Dim NewMenuItem As CommandBarButton
|
|
| Set DataMenu = CommandBars(1).FindControl(ID:=30011)
|
| Set NewMenuItem = DataMenu.Controls.Add _
| (Type:=msoControlButton)
| With NewMenuItem
| .Caption = "&eeprom"
| .OnAction = "emc"
| .BeginGroup = True
| End With
|
| End Sub
|
| Sub emc()
| UserFormEMC.Show
| End Sub
|
| This works and added a menu eeprom in main menu data.
|
| I am not able to delete the menu eeprom ? How do I do that?
|
| Thanks in advance
|
| Ravi
|
|




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Headers and Footers that are in the drop down Menu? Lisa Excel Discussion (Misc queries) 1 March 5th 07 06:33 PM
Deleting an otpion on the drop down menu on a pivot table Accountant Williams Excel Discussion (Misc queries) 5 September 28th 05 12:28 PM
How do I get Goal Seek back after deleting it from the Tools menu. mdamsgaard Excel Discussion (Misc queries) 0 March 22nd 05 07:17 AM
Deleting a Menu Bar Sophie Excel Programming 5 July 18th 04 08:29 PM
Problems deleting custom menu = double entries BenD Excel Programming 2 November 3rd 03 11:14 AM


All times are GMT +1. The time now is 03:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"