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


No comments:

Post a Comment

Hi User, Thank You for Visiting My Blog. Please Post Your Feedback/Comments/Query.

Subscribe to Blog Posts by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts