{"id":12107,"date":"2011-12-16T18:56:29","date_gmt":"2011-12-16T18:56:29","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=1028"},"modified":"2011-12-16T18:56:29","modified_gmt":"2011-12-16T18:56:29","slug":"disable-right-click-excel-macro","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/12\/disable-right-click-excel-macro\/","title":{"rendered":"How to Disable Right Click in Excel Workbook"},"content":{"rendered":"
Some times for some security reason or some other reason, you want to disable right click on the Workbook<\/strong> or Worksheet <\/strong> or on a particular Cell or Cell Range.<\/p>\n <\/a><\/p>\n Steps:<\/strong><\/p>\n 1. <\/strong> Open Visual Basic Editor (Alt + F11)<\/strong> How to Disable Right Click<\/p><\/div>\n <\/p>\n\n
1. Disable Right Click on Whole Workbook<\/h2>\n
\n2. <\/strong> Double Click on Highlighted part in below Image
\n3. <\/strong> Copy and Paste the below Code and you are done \ud83d\ude42 \ud83d\ude42<\/p>\n
<\/a>Private Sub Workbook_SheetBeforeRightClick _\n(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)\nCancel = True\nMsgBox (\"Sorry Right Click is Disbaled for this Workbook\")\nEnd Sub<\/code><\/pre>\n