+ Reply to Thread
Results 1 to 4 of 4

Disable Right Click in Spreadsheet

  1. #1
    Tywardreath
    Guest

    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. #2
    Gary Keramidas
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #4
    Tywardreath
    Guest

    Re: Disable Right Click in Spreadsheet

    Hi

    This code did the trick.

    Thanks
    Ty



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1