Prevent right click on slicers

Hi,

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

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook 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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.