PC Review


Reply
Thread Tools Rate Thread

Custom Menus With Excel 2007

 
 
=?Utf-8?B?TWlrZSBILg==?=
Guest
Posts: n/a
 
      12th Nov 2007
Recently some users got new PC's with Vista and Excel 2007. Now this macro
does not build a custom menu when the file is opened? Can I have my code
detect the version of Excel and then is there a modified version of this
menu-building macro for Excel 2007?

Private Sub Workbook_Open()

Dim Menu1 As CommandBarControl
Dim MainMenuBar As CommandBar
Dim CustomMenu As CommandBarControl
On Error Resume Next
Application.CommandBars("Worksheet Menu
Bar").Controls("&JournalEntries").Delete
On Error GoTo 0
Set MainMenuBar = Application.CommandBars("Worksheet Menu Bar")
HelpMenu = MainMenuBar.Controls("Help").Index
Set CustomMenu = MainMenuBar.Controls.Add(Type:=msoControlPopup,
Before:=HelpMenu)
CustomMenu.Caption = "&JournalEntries"
With CustomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "ValidateJE"
.OnAction = "ValidateOneJe"
End With

 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      13th Nov 2007
>>Now this macro does not build a custom menu when the file is opened?

It does but you have to switch to the Add-ins tab to find it.


--
Jim
"Mike H." <(E-Mail Removed)> wrote in message
news:5A6758BD-FE0F-4C9C-BCD9-(E-Mail Removed)...
> Recently some users got new PC's with Vista and Excel 2007. Now this
> macro
> does not build a custom menu when the file is opened? Can I have my code
> detect the version of Excel and then is there a modified version of this
> menu-building macro for Excel 2007?
>
> Private Sub Workbook_Open()
>
> Dim Menu1 As CommandBarControl
> Dim MainMenuBar As CommandBar
> Dim CustomMenu As CommandBarControl
> On Error Resume Next
> Application.CommandBars("Worksheet Menu
> Bar").Controls("&JournalEntries").Delete
> On Error GoTo 0
> Set MainMenuBar = Application.CommandBars("Worksheet Menu Bar")
> HelpMenu = MainMenuBar.Controls("Help").Index
> Set CustomMenu = MainMenuBar.Controls.Add(Type:=msoControlPopup,
> Before:=HelpMenu)
> CustomMenu.Caption = "&JournalEntries"
> With CustomMenu.Controls.Add(Type:=msoControlButton)
> .Caption = "ValidateJE"
> .OnAction = "ValidateOneJe"
> End With
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Custom Right Click Menus for Connectors and Shapes Joe B. Microsoft Excel Programming 4 17th Mar 2009 01:48 PM
Excel 2007 Custom Right Click Menus for Connectors and Shapes - Re Joe B. Microsoft Excel Programming 0 17th Mar 2009 11:34 AM
Custom Menus in 2007 Larry Salvucci Microsoft Access 1 5th Dec 2008 10:14 AM
Can you set up custom menus in Excel 2007? KRiffe Microsoft Excel Programming 1 12th Jan 2008 05:39 PM
Excel 2007 - Custom menus is missing! =?Utf-8?B?U8O4cmVuIFRoYWRlIFBldGVyc2Vu?= Microsoft Excel Misc 3 11th Jul 2006 01:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:31 AM.