Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default creating my own menu item in excel

I want to replace existing menu (File, Edit,........ Help) with my own
menu for my simple accounting application using macros. on closing the
application the system menu should be restored.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default creating my own menu item in excel

Dear Asraf

The below two procedures one for Adding menus and one for removing menus
should help. Please try and post back for any further help

If this post helps click Yes
---------------
Jacob Skaria

Sub AddMenus()

Dim cMenu1 As CommandBarControl
Dim cbMainMenuBar As CommandBar
Dim iHelpMenu As Integer
Dim cbcCutomMenu As CommandBarControl

On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Tool-&Kit").Delete
On Error GoTo 0

Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar")
iHelpMenu = cbMainMenuBar.Controls("Help").Index
Set cbcCutomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup,
Befo=iHelpMenu)
cbcCutomMenu.Caption = "Tool-&Kit"
Set cbcCutomMenu = cbcCutomMenu.Controls.Add(Type:=msoControlPopup)
cbcCutomMenu.Caption = "Consolidate open sheets"
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "Start from Row 1"
.OnAction = "ConOpenSheets1"
End With
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "Start from Row 2"
.OnAction = "ConOpenSheets2"
End With
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "Specify Row"
.OnAction = "ConOpenSheets3"
End With

End Sub

Sub DeleteMenu()

On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Tool-&Kit").Delete
On Error GoTo 0

End Sub

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
No Data Analysis item in Excel Tools menu. Now what? ainoni Excel Worksheet Functions 4 September 23rd 08 07:44 PM
Adding a menu item to Excel Uzi Barzilai Excel Discussion (Misc queries) 1 January 14th 08 10:25 AM
Control item PRINT in menu FILE of Excel [email protected] Excel Discussion (Misc queries) 0 April 6th 06 10:25 AM
Excel 2000 Custom Menu Item Larry Bird Excel Discussion (Misc queries) 0 November 8th 05 08:25 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM


All times are GMT +1. The time now is 01:29 PM.

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

About Us

"It's about Microsoft Excel"