![]() |
Using Excel 2007 with Excel 2003 template
Hi All
I have Excel 2003 menu, In Excel 2007 can not able to user. Any suggestion ? Const XMENU = "PERSONAL" Sub Auto_open() '~~ VBA Call PerActiveMenu End Sub Sub Auto_close() Call PerDeleteMenu End Sub Sub PerDeleteMenu() On Error Resume Next CommandBars(1).Controls(XMENU).Delete End Sub Sub PerActiveMenu() '~~ Sub menu Dim HelpMenu As CommandBarControl Dim NewMenu As CommandBarPopup Dim MenuItem As CommandBarControl Dim SubMenuItem As CommandBarControl '~~ delete the menu if it already exists Call PerDeleteMenu '~~ find the help Menu Set HelpMenu = CommandBars(1).FindControl(ID:=30010) If HelpMenu Is Nothing Then Set NewMenu = CommandBars(1).Controls _ .Add(Type:=msoControlPopup, temporary:=True) Else Set NewMenu = CommandBars(1).Controls _ .Add(Type:=msoControlPopup, befo=HelpMenu.Index, _ temporary:=True) End If '~~ Add a caption for the menu NewMenu.Caption = XMENU '~~ First Menu Item Set MenuItem = NewMenu.Controls.Add _ (Type:=msoControlButton) With MenuItem .Caption = "Page Format" .FaceId = 0 ' .OnAction = "Personal_Page_Format" End With Set MenuItem = NewMenu.Controls.Add _ (Type:=msoControlButton) With MenuItem .Caption = "Planning Project Date" .FaceId = 0 ' .OnAction = "perPlanningProjectDate" -<---------------------- get error here End With |
Using Excel 2007 with Excel 2003 template
moonhk laid this down on his screen :
Hi All I have Excel 2003 menu, In Excel 2007 can not able to user. Any suggestion ? Const XMENU = "PERSONAL" Sub Auto_open() '~~ VBA Call PerActiveMenu End Sub Sub Auto_close() Call PerDeleteMenu End Sub Sub PerDeleteMenu() On Error Resume Next CommandBars(1).Controls(XMENU).Delete End Sub Sub PerActiveMenu() '~~ Sub menu Dim HelpMenu As CommandBarControl Dim NewMenu As CommandBarPopup Dim MenuItem As CommandBarControl Dim SubMenuItem As CommandBarControl '~~ delete the menu if it already exists Call PerDeleteMenu '~~ find the help Menu Set HelpMenu = CommandBars(1).FindControl(ID:=30010) If HelpMenu Is Nothing Then Set NewMenu = CommandBars(1).Controls _ .Add(Type:=msoControlPopup, temporary:=True) Else Set NewMenu = CommandBars(1).Controls _ .Add(Type:=msoControlPopup, befo=HelpMenu.Index, _ temporary:=True) End If '~~ Add a caption for the menu NewMenu.Caption = XMENU '~~ First Menu Item Set MenuItem = NewMenu.Controls.Add _ (Type:=msoControlButton) With MenuItem .Caption = "Page Format" .FaceId = 0 ' .OnAction = "Personal_Page_Format" End With Set MenuItem = NewMenu.Controls.Add _ (Type:=msoControlButton) With MenuItem .Caption = "Planning Project Date" .FaceId = 0 ' .OnAction = "perPlanningProjectDate" -<---------------------- get error here End With Did you check the Addins tab to see if your menu was listed in the Custom Menus group? -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
All times are GMT +1. The time now is 06:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com