Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get this to work in 2003 but not 2007
context / popup menu works for Cell but not connector or shapes in 2007. Works in 2003. I understand the ribbon messes up regular menus, but what am I missing with 2007 right click menus? I have a more complex version of the code below I intend to use - but I ran this simple one to see if it would work in 2007 and 2003 (make sure did not have other code issues). Sub editconnector() Dim MenuItem As Object Dim i, j As Integer Application.CommandBars("connector").Reset Application.CommandBars("shapes").Reset Dim MyMenu As Object Set MyMenu = Application.CommandBars("connector") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton, Befo=1, temporary:=False) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester2" MenuItem.Visible = True MsgBox (MenuItem.Caption) Set MyMenu = Application.CommandBars("shapes") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester3" MsgBox (MenuItem.Caption) End Sub -- - Joe B. - ExcelToolsforEngineers |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
xl2007 replaced the commandbars with the ribbon.
So you can learn a lot about the ribbon (or how to modify the quick access toolbar)... I'd start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm Or maybe you could weasel and create your own "toolbar". It'll show up in the Addin's tab of the ribbon in xl2007. Here's how I do it when I want a toolbar: http://www.contextures.com/xlToolbar02.html (from Debra Dalgleish's site) Joe B. wrote: I get this to work in 2003 but not 2007 context / popup menu works for Cell but not connector or shapes in 2007. Works in 2003. I understand the ribbon messes up regular menus, but what am I missing with 2007 right click menus? I have a more complex version of the code below I intend to use - but I ran this simple one to see if it would work in 2007 and 2003 (make sure did not have other code issues). Sub editconnector() Dim MenuItem As Object Dim i, j As Integer Application.CommandBars("connector").Reset Application.CommandBars("shapes").Reset Dim MyMenu As Object Set MyMenu = Application.CommandBars("connector") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton, Befo=1, temporary:=False) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester2" MenuItem.Visible = True MsgBox (MenuItem.Caption) Set MyMenu = Application.CommandBars("shapes") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester3" MsgBox (MenuItem.Caption) End Sub -- - Joe B. - ExcelToolsforEngineers -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yeah I heard of that - I am under the impression that all of the shortcut
menus (right click menus) such as when right clicking on a connector that is on a worksheet - are still customizable, but that the commandbars that are part of the old menu structure are not. The textbooks and online help I have found so far suggests I should be able to still do it (right click shortcut menus). Thx for the reply - let me know if you have any further thoughts. -- - Joe B. - ExcelToolsforEngineers "Dave Peterson" wrote: xl2007 replaced the commandbars with the ribbon. So you can learn a lot about the ribbon (or how to modify the quick access toolbar)... I'd start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm Or maybe you could weasel and create your own "toolbar". It'll show up in the Addin's tab of the ribbon in xl2007. Here's how I do it when I want a toolbar: http://www.contextures.com/xlToolbar02.html (from Debra Dalgleish's site) Joe B. wrote: I get this to work in 2003 but not 2007 context / popup menu works for Cell but not connector or shapes in 2007. Works in 2003. I understand the ribbon messes up regular menus, but what am I missing with 2007 right click menus? I have a more complex version of the code below I intend to use - but I ran this simple one to see if it would work in 2007 and 2003 (make sure did not have other code issues). Sub editconnector() Dim MenuItem As Object Dim i, j As Integer Application.CommandBars("connector").Reset Application.CommandBars("shapes").Reset Dim MyMenu As Object Set MyMenu = Application.CommandBars("connector") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton, Befo=1, temporary:=False) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester2" MenuItem.Visible = True MsgBox (MenuItem.Caption) Set MyMenu = Application.CommandBars("shapes") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester3" MsgBox (MenuItem.Caption) End Sub -- - Joe B. - ExcelToolsforEngineers -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh, oh.
I didn't notice that these were the popup type menus. I don't use xl2007 enough to help. If you don't get any more responses to this thread, you may want to write another followup saying that you re-asked your question in a new thread. (I'm afraid that I may have poisoned the well for this one.) Joe B. wrote: Yeah I heard of that - I am under the impression that all of the shortcut menus (right click menus) such as when right clicking on a connector that is on a worksheet - are still customizable, but that the commandbars that are part of the old menu structure are not. The textbooks and online help I have found so far suggests I should be able to still do it (right click shortcut menus). Thx for the reply - let me know if you have any further thoughts. -- - Joe B. - ExcelToolsforEngineers "Dave Peterson" wrote: xl2007 replaced the commandbars with the ribbon. So you can learn a lot about the ribbon (or how to modify the quick access toolbar)... I'd start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm Or maybe you could weasel and create your own "toolbar". It'll show up in the Addin's tab of the ribbon in xl2007. Here's how I do it when I want a toolbar: http://www.contextures.com/xlToolbar02.html (from Debra Dalgleish's site) Joe B. wrote: I get this to work in 2003 but not 2007 context / popup menu works for Cell but not connector or shapes in 2007. Works in 2003. I understand the ribbon messes up regular menus, but what am I missing with 2007 right click menus? I have a more complex version of the code below I intend to use - but I ran this simple one to see if it would work in 2007 and 2003 (make sure did not have other code issues). Sub editconnector() Dim MenuItem As Object Dim i, j As Integer Application.CommandBars("connector").Reset Application.CommandBars("shapes").Reset Dim MyMenu As Object Set MyMenu = Application.CommandBars("connector") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton, Befo=1, temporary:=False) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester2" MenuItem.Visible = True MsgBox (MenuItem.Caption) Set MyMenu = Application.CommandBars("shapes") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester3" MsgBox (MenuItem.Caption) End Sub -- - Joe B. - ExcelToolsforEngineers -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Joe has reposted the question.
Dave Peterson wrote: Oh, oh. I didn't notice that these were the popup type menus. I don't use xl2007 enough to help. If you don't get any more responses to this thread, you may want to write another followup saying that you re-asked your question in a new thread. (I'm afraid that I may have poisoned the well for this one.) Joe B. wrote: Yeah I heard of that - I am under the impression that all of the shortcut menus (right click menus) such as when right clicking on a connector that is on a worksheet - are still customizable, but that the commandbars that are part of the old menu structure are not. The textbooks and online help I have found so far suggests I should be able to still do it (right click shortcut menus). Thx for the reply - let me know if you have any further thoughts. -- - Joe B. - ExcelToolsforEngineers "Dave Peterson" wrote: xl2007 replaced the commandbars with the ribbon. So you can learn a lot about the ribbon (or how to modify the quick access toolbar)... I'd start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm Or maybe you could weasel and create your own "toolbar". It'll show up in the Addin's tab of the ribbon in xl2007. Here's how I do it when I want a toolbar: http://www.contextures.com/xlToolbar02.html (from Debra Dalgleish's site) Joe B. wrote: I get this to work in 2003 but not 2007 context / popup menu works for Cell but not connector or shapes in 2007. Works in 2003. I understand the ribbon messes up regular menus, but what am I missing with 2007 right click menus? I have a more complex version of the code below I intend to use - but I ran this simple one to see if it would work in 2007 and 2003 (make sure did not have other code issues). Sub editconnector() Dim MenuItem As Object Dim i, j As Integer Application.CommandBars("connector").Reset Application.CommandBars("shapes").Reset Dim MyMenu As Object Set MyMenu = Application.CommandBars("connector") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton, Befo=1, temporary:=False) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester2" MenuItem.Visible = True MsgBox (MenuItem.Caption) Set MyMenu = Application.CommandBars("shapes") j = MyMenu.Controls.Count For i = 1 To j MsgBox (MyMenu.Controls(i).Caption) Next i Set MenuItem = MyMenu.Controls.Add(Type:=msoControlButton) MenuItem.BeginGroup = True MenuItem.OnAction = ThisWorkbook.Name & "!" & "do_analysis" MenuItem.Caption = "Tester3" MsgBox (MenuItem.Caption) End Sub -- - Joe B. - ExcelToolsforEngineers -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shapes and Connectors | Excel Programming | |||
Can you set up custom menus in Excel 2007? | Excel Programming | |||
Custom Menus With Excel 2007 | Excel Programming | |||
Custom Right Click Menus - Inconsistent Functionality | Excel Discussion (Misc queries) | |||
Excel 2007 - Custom menus is missing! | Excel Discussion (Misc queries) |