Sunday, 20 March 2016

How to disable Right Click Option in the Excel with VBA

Workbook and Worksheet Events to Disable the  Right Click Option in the Excel
WorkSheet Event :
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)

Cancel = True

 MsgBox ("Sorry the Right Click is Disabled in this WorkSheet")
End Sub


WorkBook Event :
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)

Cancel = True

 MsgBox ("Sorry The Right Click is Disabled for this Workbook")
End Sub



--------------------------------------------------------------------------------------------------------
Thanks, TAMATAM ; Business Intelligence & Analytics Professional
--------------------------------------------------------------------------------------------------------

No comments:

Post a Comment

Hi User, Thank You for visiting My Blog. Please post your open Feedback only related to this Blog Posts. Please note that I cannot respond to the Anonymous Comments.

Subscribe to Blog Posts by Email

ExcelKingdom-Popular Posts