Excel 2016 Custom VBA Context Menu

Dan123

New Member
Joined
Oct 11, 2017
Messages
1
We have moved from Excel 2007 to Excel 2016 (Office 365). I have several macros that use vba to add a cell context (right click) menu item.

All worked before, but it seems moving from multiple document interface to single document interface has caused these to not work as planned.

I can open the macro workbook and the menu item(s) are there. But in the data workbook (where the right click happens), they are not showing. Does the order of opening the workbooks matter (i.e. macro first, then data or data, then macro)? And does it matter if the data workbook is opened from Outlook?

Any and all suggestions appreciated.

Thanks

This is my code:

Sub Menu_Copy_Data()
On Error GoTo one
If CommandBars("Cell").Controls("Copy Garnishment Data").Visible Then
Exit Sub
End If


one:
Dim ThisItem As Object
Set ThisItem = CommandBars("Cell").Controls.Add
With ThisItem
.Caption = "Copy Garnishment Data"
.OnAction = "Data_Copy"
.BeginGroup = True
End With
End Sub
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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