Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Disable Right Click in Spreadsheet

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Disable Right Click in Spreadsheet

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

--
Regards,
Tom Ogilvy

"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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Disable Right Click in Spreadsheet

Hi

This code did the trick.

Thanks :)
Ty


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
disable right click on mouse jatman Excel Discussion (Misc queries) 2 June 5th 08 12:15 AM
Disable rightc click No Name Excel Programming 1 October 25th 04 02:07 PM
Disable Right click No Name Excel Programming 3 September 24th 04 03:27 PM
Disable right-click fredbibi49 Excel Programming 1 June 14th 04 10:44 AM
Disable right click Rich Cooper Excel Programming 2 May 14th 04 02:54 PM


All times are GMT +1. The time now is 02:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"