Shapes Context menu 2007

mightymishra

Board Regular
Joined
Oct 18, 2002
Messages
65
Hi All,

I have a piece of code (pasted below) that is not displaying the context menu on shapes, in 2007 (works in 2003).

The "AddRightClick" code adds an item "NEW ITEM", displayed in msgbox using "CheckRighClick" code , however does not show it when right clicked on the shape.

i am not sure if it is possible to get a context menu for shapes in Excel 2007.

CODE:
Sub AddRightClick()
With Application.CommandBars("Shapes")
Set oBtn = .Controls.Add(msoControlButton)
oBtn.Caption = "NEW ITEM"
oBtn.Visible = True
oBtn.Enabled = True
End With
CheckRighClick
End Sub

Sub CheckRighClick()
Dim CBItem As CommandBarControl
Dim Temp As String

For Each CBItem In Application.CommandBars("Shapes").Controls
Temp = Temp + CBItem.Caption & Chr(10)
Next
MsgBox Temp
End Sub

Sub ResetRightClick()
Application.CommandBars("Shapes").Reset
End Sub

Thanks,
Mighty
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
The above msdn link reads :

In Excel 2007, you can add controls to almost every context menu with VBA code. However, it is not possible to change some context menus such as the Shapes and Picture context menu with VBA. In addition, it is not possible to change context menus with RibbonX.

Does that mean one cannot customize the Shapes context menu in XL 2007 neither via VBA nor via RibbonX ? !

I don't have Excel 2007 to test it .. Can anyone confirm this ?

Regards.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top