Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to have a macro simply issue the "find" command or "control f: | Excel Programming | |||
i do not see the "plot series on" option in Excel 2007 | Charts and Charting in Excel | |||
I can't find the command button control object in Excel 2007 | Excel Discussion (Misc queries) | |||
Please do not remove "Address" command from Excel 2007 | Excel Worksheet Functions | |||
"cannot insert object" in Excel (even a button from Control Toolbox) | Excel Programming |