How to detect a mouse right-click?

peterzeke

New Member
Joined
Jun 15, 2005
Messages
2
Is there a way to detect a mouse-right-click in Excel using VBA, particularly if the mouse-right-click occurs in a cell?

If not, is there a way to send a mouse-right-click to a particular toolbar item similar to a sendkeys method?

In case you're wondering what this is all about.... I have an Excel Add-in for OLAP analysis that refreshes its connections to OLAP cubes only when an end-user right-clicks on a cell within an olap analysis grid (comparable to a pivottable). I've tried recording a macro to capture this event unsuccessfully.

Any help will be greatly appreciated!
Thanks,
Pete
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Go to either the worksheets code module or the ThisWrokbook code module. In the window above the module there are 2 dropdowns. On the leftone select either "Worksheet" or "Workbook" (depends on whichmodule you are in. The on the left dropdown select SheetBeforeRightClick. That is the event handler to catch a right-click on a worksheet/workbook
 
Upvote 0
Go to either the worksheets code module or the ThisWrokbook code module. In the window above the module there are 2 dropdowns. On the leftone select either "Worksheet" or "Workbook" (depends on whichmodule you are in. The on the left dropdown select SheetBeforeRightClick. That is the event handler to catch a right-click on a worksheet/workbook
i know, but don't help

need to catch outside excel as well
 
Upvote 0

Forum statistics

Threads
1,221,787
Messages
6,161,960
Members
451,734
Latest member
Anmol Pandey19

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