Prevent right click on slicers

Hi,

How do I prevent right click on my slicers in one worksheet?
Marcell999Asked:
Who is Participating?
 
Wilder1626Commented:
Sorry.

Besides putting a password to protect your sheet, i cannot see another way to lock right click on slicer.

Let's see if somebody else comeback with another idea.
0
 
Wilder1626Commented:
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

0
 
Marcell999Author Commented:
Hi Jean ,

It's not working on the slicers. It works on other cells though, but not what I need
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Patrick MatthewsCommented:
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.
0
 
Wilder1626Commented:
Marcell999
then i don't think there is much to do. Sorry.
0
 
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.