View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas[_4_] Gary Keramidas[_4_] is offline
external usenet poster
 
Posts: 226
Default Disable Right Click in Spreadsheet

try this on the code page for this workbook:

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)
Cancel = True 'prevents normal RClick menu from appearing
End Sub

or put your code on each sheet's code page.

your code works here with excel 2k3

--


Gary


"Tywardreath" wrote in message
...
Hi

I've found the following code to disable right clicking with a
spreadsheet,
however within Excel 2003 it doesn't work.

Private Sub Worksheet_BeforeRightClick(ByVal Target _
As Excel.Range, Cancel As Boolean)
Cancel = True 'prevents normal RClick menu from appearing
End Sub

Does anyone know how to stop right clicking?

Cheers, Ty