Disable Right Click in Spreadsheet

G

Guest

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
 
G

Gary Keramidas

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
 
T

Tom Ogilvy

It should work in xl2003. Perhaps you have security set to high and macros
have been silently disabled.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top