Link to home
Start Free TrialLog in
Avatar of Marcell999
Marcell999Flag for Australia

asked on

Prevent right click on slicers

Hi,

How do I prevent right click on my slicers in one worksheet?
Avatar of Wilder1626
Wilder1626
Flag of Canada image

Hi

Is that what you are looking for?
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub

Open in new window


If you want to tell them that they cannot right click:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
 Cancel = True
 MsgBox "Right click not accepted on this sheet"
End Sub

Open in new window

Avatar of Marcell999

ASKER

Hi Jean ,

It's not working on the slicers. It works on other cells though, but not what I need
ASKER CERTIFIED SOLUTION
Avatar of Wilder1626
Wilder1626
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The short answer is, you can't.

There are no Slicer events exposed in VBA.  Theoretically you could use the worksheet events capturing the update of a PivotTable, but by then whatever the user did via right-click has already happened.
Marcell999
then i don't think there is much to do. Sorry.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.