Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Pesty Protection Warning has been solved! Already! Thanks

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Good Morning Friends!
    Can someone take a look at the following code and tell me how I can keep the protected sheet warning from popping up?
    The code in the event functions as it should and the values change as they should but the protection warning pops up after the event exits.
    Not a huge deal, but would like to know how to get rid of this msgbox. Thanks!
    Tom


    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim CurrentCategory As String
    Dim RowCntr As Long
    Dim HoldSelectionRow As Long

    ActiveSheet.Unprotect
    Application.ScreenUpdating = False
    Application.EnableEvents = False

    'Code Here

    Application.EnableEvents = True
    ActiveSheet.Protect
    End Sub


    [ This Message was edited by: TsTom on 2002-04-02 01:46 ]

    [ This Message was edited by: TsTom on 2002-04-02 01:51 ]

    [ This Message was edited by: TsTom on 2002-04-02 01:53 ]

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Tom

    Use the Cancel argument, and set it to True. I would say Excel is trying to go into Edit Mode after the code has run.

    Just put:

    Cancel=True

    as the first line.


Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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