Right Click Button

  • Thread starter Thread starter T.R.
  • Start date Start date
T

T.R.

I downloaded the XY Chart Labler into Excel and I would
like to add it to my right click button.

Is there a way to add something to the right click button?

Thanks.

T.R.
 
Rob Bovey's XY Chart Labeler?

If yes, then Rob's code is open for you to change.

But first save a copy (just in case) and second if this breaks Rob's addin, you
can't complain to Rob!

Get to the VBE and open the xychartlabeler project.
Expand the project explorer until you can see Modules.
Under Modules is code that adds the option to the menubars. It's called
MOpenClose.

Modify it slightly:

In the Auto_open Sub:
Change #1:
Dim ctlToolsMenu As Office.CommandBarPopup
becomes
Dim ctlToolsMenu As Object 'Office.CommandBarPopup

Change #2:
Set ctlToolsMenu = Application.CommandBars(lCount).FindControl(, glMENU_TOOLS)
becomes
Select Case lCount
Case 1, 2
Set ctlToolsMenu _
= Application.CommandBars(lCount).FindControl(, glMENU_TOOLS)
Case 3
Set ctlToolsMenu = Application.CommandBars("Cell")
Case 4
Set ctlToolsMenu = Application.CommandBars("Object/Plot")
End Select

In the Auto_Close sub:

Right before the "End Sub" add these two lines:

Application.CommandBars("cell").Controls(gszMENU_APP).Delete
Application.CommandBars("object/plot").Controls(gszMENU_APP).Delete

=========
This adds the xychart stuff to the rightclick menu when you click on a cell and
also when you click on the chart--(not all elements of the chart, though).

Remember to keep a back up copy of Rob's addin--just in case.
 
Back
Top