Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Custom Menus With Excel 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,
Befo=HelpMenu)
CustomMenu.Caption = "&JournalEntries"
With CustomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "ValidateJE"
.OnAction = "ValidateOneJe"
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default Custom Menus With Excel 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." wrote in message
...
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,
Befo=HelpMenu)
CustomMenu.Caption = "&JournalEntries"
With CustomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "ValidateJE"
.OnAction = "ValidateOneJe"
End With



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
Sub-menus of main menus for Excel 2007 Eleanor Peppard New Users to Excel 1 March 16th 10 04:12 PM
Adding custom menus to Excel ???? JoeJoe Excel Programming 2 October 30th 06 09:45 PM
Excel 2007 - Custom menus is missing! Søren Thade Petersen Excel Discussion (Misc queries) 3 July 11th 06 01:59 AM
Excel & Custom Menus Stuart[_14_] Excel Programming 2 December 23rd 03 02:28 PM
Excel.xlb and Custom Menus Taher Baderkhan[_2_] Excel Programming 2 October 10th 03 06:38 PM


All times are GMT +1. The time now is 01:13 AM.

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"