Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Control not added to "Object/Plot" command bar in Excel 2007

I'm trying to add a control to the "Object/Plot" and the "Picture Context
Menu" command bars in Excel 2007. I don't get any errors when I add the
controls, but when I right click on a chart or a picture I don't see the new
controls in the context menu or in the Add-In ribbon. If I add a control to
the "Cell" command bar it works as expected.

My OS is Windows XP, SP2.

I created a very simple test that works in Excel 2003, but does not work in
Excel 2007. I don't get any errors. How do you add controls to these
Context Menus in Excel 2007?

Here is the sample code:

Dim chartCommandBar As CommandBar
Dim pictureCommandBar As CommandBar
Dim cellCommandBar As CommandBar
Dim newChartControl As CommandBarControl
Dim newPictureControl As CommandBarControl
Dim newCellControl As CommandBarControl

Set chartCommandBar = ActiveWorkbook.Application.CommandBars("Object/Plot")
Set pictureCommandBar = ActiveWorkbook.Application.CommandBars("Pictures
Context Menu")
Set cellCommandBar = ActiveWorkbook.Application.CommandBars("Cell")

Set newChartControl =
chartCommandBar.Controls.Add(Office.MsoControlType .msoControlButton,
Temporary:=True)

newChartControl.Caption = "Chart Clickme!"
newChartControl.Tag = "Chart.ClickMe.Menu"
newChartControl.Visible = True

Set newPictureControl =
pictureCommandBar.Controls.Add(Office.MsoControlTy pe.msoControlButton,
Temporary:=True)

newPictureControl.Caption = "Picture Clickme!"
newPictureControl.Tag = "Picture.ClickMe.Menu"
newPictureControl.Visible = True

Set newCellControl =
cellCommandBar.Controls.Add(Office.MsoControlType. msoControlButton,
Temporary:=True)

newCellControl.Caption = "Cell Clickme!"
newCellControl.Tag = "Cell.ClickMe.Menu"
newCellControl.Visible = True


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
How to have a macro simply issue the "find" command or "control f: Charles Adams Excel Programming 3 February 6th 09 06:34 PM
i do not see the "plot series on" option in Excel 2007 Maithily Charts and Charting in Excel 2 October 17th 07 08:52 AM
I can't find the command button control object in Excel 2007 Raas Excel Discussion (Misc queries) 4 April 2nd 07 03:46 PM
Please do not remove "Address" command from Excel 2007 S Hung Excel Worksheet Functions 0 September 25th 06 10:34 AM
"cannot insert object" in Excel (even a button from Control Toolbox) Matthew Lee Excel Programming 1 April 30th 04 05:58 PM


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