Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel 2007 Custom Right Click Menus for Connectors and Shapes - Re

Reposting - other answers did not address ? (misinterpreted ?)

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
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
Excel 2007 Custom Right Click Menus for Connectors and Shapes Joe B. Excel Programming 4 March 17th 09 01:48 PM
Shapes and Connectors Andrew R. Page Excel Programming 1 February 21st 09 01:44 AM
Can you set up custom menus in Excel 2007? KRiffe Excel Programming 1 January 12th 08 05:39 PM
Custom Menus With Excel 2007 Mike H. Excel Programming 1 November 13th 07 12:45 AM
Excel 2007 - Custom menus is missing! Søren Thade Petersen Excel Discussion (Misc queries) 3 July 11th 06 01:59 AM


All times are GMT +1. The time now is 08:10 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"