Disable Right-click

WJReid

Active Member
Joined
Jul 26, 2002
Messages
317
Hi All,

Can anyone give me the code to disable the Right-click toolbar?

Thanks in advance for any help.

Regards,

Bill
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi Bill,

May be this helps without a macro. Open your form in design mode and goto Properties window and Other tab "Shortcut Menu" property : set is as No.

If you want to control this in VBA then:

Code:
  FormName.ShortcutMenu = False

I hope it helps.
Suat
 
Upvote 0
Hi Suat,

Thank you very much for the reply. I am actually looking to disable the Right-click on a Worksheet, not a Form. Sorry, I should have made that clearer at the outset.


Regards,

Bill
 
Upvote 0
Hi Bill,

I thought that it is Access question.

For worksheet object, you can goto worksheet class module and cancel the right click in Worksheet's BeforeRightClick event.

Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    Cancel = True
End Sub

Suat
 
Upvote 0
Hi Suat,

Thank you very much for your help. You were correct in thinking that it was an Access question. I needed to disable the right-click in both Access and Excel and should have put the question in both forums. I got the Forums mixed up and was thinking that I was in the Excel Forum.

Thank you once again, your infomation is perfect.

Regards,

Bill
 
Upvote 0

Forum statistics

Threads
1,221,773
Messages
6,161,855
Members
451,724
Latest member
sledparty

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