Catch user error and re-enable application.events after error












2















Amateur coder asking for help, again :-)



I have the below code that works good, it gets a variable from a drop down validation list and executes command automatically because I and using the Private Sub Worksheet_Change(ByVal Target As Range). The issue I have is that sometimes the user types into the box rather then select it.



I get a




run-time error 91




because it cannot find the value typed in by user.



How can I catch this error and make a message popup to tell them they must choose from drop down list? And Also since it breaks the code it sets my Application.EnableEvents to False since it doesn't finish the code from the ByVal Target As Range section that resets to True.



How can I reset the Application.EnableEvents to True in the event of a code break?



Sub Copy_From_Borrower_DBase()
Dim myVal As String
Dim sourceRng As Range
myVal = Sheets("Main").Range("F2").Value ' dropdown list
Set sourceRng = Worksheets("Borrower Database").Range("5:5").Find(What:=myVal, LookAt:=xlWhole) 'locate column where to copy from
Worksheets("Main").Range("F5").Value = Worksheets("Borrower Database").Cells(5, sourceRng.Column).Value 'Borrower Name
Worksheets("Main").Range("G6").Value = Worksheets("Borrower Database").Cells(6, sourceRng.Column).Value 'Income
End Sub









share|improve this question





























    2















    Amateur coder asking for help, again :-)



    I have the below code that works good, it gets a variable from a drop down validation list and executes command automatically because I and using the Private Sub Worksheet_Change(ByVal Target As Range). The issue I have is that sometimes the user types into the box rather then select it.



    I get a




    run-time error 91




    because it cannot find the value typed in by user.



    How can I catch this error and make a message popup to tell them they must choose from drop down list? And Also since it breaks the code it sets my Application.EnableEvents to False since it doesn't finish the code from the ByVal Target As Range section that resets to True.



    How can I reset the Application.EnableEvents to True in the event of a code break?



    Sub Copy_From_Borrower_DBase()
    Dim myVal As String
    Dim sourceRng As Range
    myVal = Sheets("Main").Range("F2").Value ' dropdown list
    Set sourceRng = Worksheets("Borrower Database").Range("5:5").Find(What:=myVal, LookAt:=xlWhole) 'locate column where to copy from
    Worksheets("Main").Range("F5").Value = Worksheets("Borrower Database").Cells(5, sourceRng.Column).Value 'Borrower Name
    Worksheets("Main").Range("G6").Value = Worksheets("Borrower Database").Cells(6, sourceRng.Column).Value 'Income
    End Sub









    share|improve this question



























      2












      2








      2








      Amateur coder asking for help, again :-)



      I have the below code that works good, it gets a variable from a drop down validation list and executes command automatically because I and using the Private Sub Worksheet_Change(ByVal Target As Range). The issue I have is that sometimes the user types into the box rather then select it.



      I get a




      run-time error 91




      because it cannot find the value typed in by user.



      How can I catch this error and make a message popup to tell them they must choose from drop down list? And Also since it breaks the code it sets my Application.EnableEvents to False since it doesn't finish the code from the ByVal Target As Range section that resets to True.



      How can I reset the Application.EnableEvents to True in the event of a code break?



      Sub Copy_From_Borrower_DBase()
      Dim myVal As String
      Dim sourceRng As Range
      myVal = Sheets("Main").Range("F2").Value ' dropdown list
      Set sourceRng = Worksheets("Borrower Database").Range("5:5").Find(What:=myVal, LookAt:=xlWhole) 'locate column where to copy from
      Worksheets("Main").Range("F5").Value = Worksheets("Borrower Database").Cells(5, sourceRng.Column).Value 'Borrower Name
      Worksheets("Main").Range("G6").Value = Worksheets("Borrower Database").Cells(6, sourceRng.Column).Value 'Income
      End Sub









      share|improve this question
















      Amateur coder asking for help, again :-)



      I have the below code that works good, it gets a variable from a drop down validation list and executes command automatically because I and using the Private Sub Worksheet_Change(ByVal Target As Range). The issue I have is that sometimes the user types into the box rather then select it.



      I get a




      run-time error 91




      because it cannot find the value typed in by user.



      How can I catch this error and make a message popup to tell them they must choose from drop down list? And Also since it breaks the code it sets my Application.EnableEvents to False since it doesn't finish the code from the ByVal Target As Range section that resets to True.



      How can I reset the Application.EnableEvents to True in the event of a code break?



      Sub Copy_From_Borrower_DBase()
      Dim myVal As String
      Dim sourceRng As Range
      myVal = Sheets("Main").Range("F2").Value ' dropdown list
      Set sourceRng = Worksheets("Borrower Database").Range("5:5").Find(What:=myVal, LookAt:=xlWhole) 'locate column where to copy from
      Worksheets("Main").Range("F5").Value = Worksheets("Borrower Database").Cells(5, sourceRng.Column).Value 'Borrower Name
      Worksheets("Main").Range("G6").Value = Worksheets("Borrower Database").Cells(6, sourceRng.Column).Value 'Income
      End Sub






      excel vba excel-vba






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 14:21









      Pᴇʜ

      23.2k62950




      23.2k62950










      asked Nov 20 '18 at 13:13









      MECMEC

      697




      697
























          3 Answers
          3






          active

          oldest

          votes


















          3














          Check first that the range does not return Nothing (meaning the term was not found). The use of With is basically cosmetic, but I think tidies up the code somewhat.



          Sub Copy_From_Borrower_DBase()

          Dim myVal As String
          Dim sourceRng As Range
          myVal = Sheets("Main").Range("F2").Value ' dropdown list

          With Worksheets("Borrower Database")
          Set sourceRng = .Range("5:5").Find(What:=myVal, LookAt:=xlWhole)
          If Not sourceRng Is Nothing Then
          Worksheets("Main").Range("F5").Value = .Cells(5, sourceRng.Column).Value 'Borrower Name"
          Worksheets("Main").Range("G6").Value = .Cells(6, sourceRng.Column).Value 'Income"
          Else
          MsgBox "whatever"
          End If
          End With

          End Sub





          share|improve this answer
























          • this worked great, can you help me with code to see if record exists and if so a msgbox to indicate YES or NO?

            – MEC
            Nov 20 '18 at 16:20











          • Quite possibly. Is this a separate question?

            – SJR
            Nov 20 '18 at 16:37











          • Ummm yeah I guess it is, should I post a new question? and mark this one as answered by you?

            – MEC
            Nov 20 '18 at 16:52











          • Yes, I think that's probably best if you are asking a whole new question. Thanks.

            – SJR
            Nov 20 '18 at 17:07











          • Whilst this may handle the error it doesn't really answer the question on how to catch the error and how to re-enable events after

            – Tom
            Nov 20 '18 at 17:57





















          1














          To answer the question about error handling:



          Public Sub MyProcedure()
          Application.EnableEvents = False

          On Error Goto ENABLE_EVENTS 'if any error occurs after this line events get enabled.

          'stuff where an error could occur

          ENABLE_EVENTS:
          Application.EnableEvents = True
          If Err.Number <> 0 Then
          MsgBox "an error occurred"
          End If
          End Sub


          For more information about error handling: VBA Error Handling – A Complete Guide.






          share|improve this answer
























          • Where do I place this code and do I have to call it from every Sub?

            – MEC
            Nov 20 '18 at 16:12











          • Everything you need to know about error handling is in that guide. Actually this is an example how you can use EnableEvents = False in your procedure and ensure it will always be re-enabled if an error occurs. That's nothing you can call from your sub, that's a how you do it in your sub.

            – Pᴇʜ
            Nov 21 '18 at 7:00





















          0














          I would first try to solve the problem by not allowing there to be a problem, if that fails then worry about error handling.



          Since you are already calling Worksheet_Change and using Data Validation, this checks the value of the validation cell. If it has a value in it then your code will run. If it is empty it will not. Data Validation clears the cell if someone types in it, so no matter what they type by the time it hits Worksheet_Change it should be an empty string.



          Private Sub Worksheet_Change(ByVal Target As Range)
          If Target.Address = "$F$2" Then ' Your Dropdown Validation Cell
          If Not Target.Value = "" Then
          Call Copy_From_Borrower_DBase
          End If
          End If
          End Sub





          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53393809%2fcatch-user-error-and-re-enable-application-events-after-error%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            Check first that the range does not return Nothing (meaning the term was not found). The use of With is basically cosmetic, but I think tidies up the code somewhat.



            Sub Copy_From_Borrower_DBase()

            Dim myVal As String
            Dim sourceRng As Range
            myVal = Sheets("Main").Range("F2").Value ' dropdown list

            With Worksheets("Borrower Database")
            Set sourceRng = .Range("5:5").Find(What:=myVal, LookAt:=xlWhole)
            If Not sourceRng Is Nothing Then
            Worksheets("Main").Range("F5").Value = .Cells(5, sourceRng.Column).Value 'Borrower Name"
            Worksheets("Main").Range("G6").Value = .Cells(6, sourceRng.Column).Value 'Income"
            Else
            MsgBox "whatever"
            End If
            End With

            End Sub





            share|improve this answer
























            • this worked great, can you help me with code to see if record exists and if so a msgbox to indicate YES or NO?

              – MEC
              Nov 20 '18 at 16:20











            • Quite possibly. Is this a separate question?

              – SJR
              Nov 20 '18 at 16:37











            • Ummm yeah I guess it is, should I post a new question? and mark this one as answered by you?

              – MEC
              Nov 20 '18 at 16:52











            • Yes, I think that's probably best if you are asking a whole new question. Thanks.

              – SJR
              Nov 20 '18 at 17:07











            • Whilst this may handle the error it doesn't really answer the question on how to catch the error and how to re-enable events after

              – Tom
              Nov 20 '18 at 17:57


















            3














            Check first that the range does not return Nothing (meaning the term was not found). The use of With is basically cosmetic, but I think tidies up the code somewhat.



            Sub Copy_From_Borrower_DBase()

            Dim myVal As String
            Dim sourceRng As Range
            myVal = Sheets("Main").Range("F2").Value ' dropdown list

            With Worksheets("Borrower Database")
            Set sourceRng = .Range("5:5").Find(What:=myVal, LookAt:=xlWhole)
            If Not sourceRng Is Nothing Then
            Worksheets("Main").Range("F5").Value = .Cells(5, sourceRng.Column).Value 'Borrower Name"
            Worksheets("Main").Range("G6").Value = .Cells(6, sourceRng.Column).Value 'Income"
            Else
            MsgBox "whatever"
            End If
            End With

            End Sub





            share|improve this answer
























            • this worked great, can you help me with code to see if record exists and if so a msgbox to indicate YES or NO?

              – MEC
              Nov 20 '18 at 16:20











            • Quite possibly. Is this a separate question?

              – SJR
              Nov 20 '18 at 16:37











            • Ummm yeah I guess it is, should I post a new question? and mark this one as answered by you?

              – MEC
              Nov 20 '18 at 16:52











            • Yes, I think that's probably best if you are asking a whole new question. Thanks.

              – SJR
              Nov 20 '18 at 17:07











            • Whilst this may handle the error it doesn't really answer the question on how to catch the error and how to re-enable events after

              – Tom
              Nov 20 '18 at 17:57
















            3












            3








            3







            Check first that the range does not return Nothing (meaning the term was not found). The use of With is basically cosmetic, but I think tidies up the code somewhat.



            Sub Copy_From_Borrower_DBase()

            Dim myVal As String
            Dim sourceRng As Range
            myVal = Sheets("Main").Range("F2").Value ' dropdown list

            With Worksheets("Borrower Database")
            Set sourceRng = .Range("5:5").Find(What:=myVal, LookAt:=xlWhole)
            If Not sourceRng Is Nothing Then
            Worksheets("Main").Range("F5").Value = .Cells(5, sourceRng.Column).Value 'Borrower Name"
            Worksheets("Main").Range("G6").Value = .Cells(6, sourceRng.Column).Value 'Income"
            Else
            MsgBox "whatever"
            End If
            End With

            End Sub





            share|improve this answer













            Check first that the range does not return Nothing (meaning the term was not found). The use of With is basically cosmetic, but I think tidies up the code somewhat.



            Sub Copy_From_Borrower_DBase()

            Dim myVal As String
            Dim sourceRng As Range
            myVal = Sheets("Main").Range("F2").Value ' dropdown list

            With Worksheets("Borrower Database")
            Set sourceRng = .Range("5:5").Find(What:=myVal, LookAt:=xlWhole)
            If Not sourceRng Is Nothing Then
            Worksheets("Main").Range("F5").Value = .Cells(5, sourceRng.Column).Value 'Borrower Name"
            Worksheets("Main").Range("G6").Value = .Cells(6, sourceRng.Column).Value 'Income"
            Else
            MsgBox "whatever"
            End If
            End With

            End Sub






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 20 '18 at 13:24









            SJRSJR

            12.9k31217




            12.9k31217













            • this worked great, can you help me with code to see if record exists and if so a msgbox to indicate YES or NO?

              – MEC
              Nov 20 '18 at 16:20











            • Quite possibly. Is this a separate question?

              – SJR
              Nov 20 '18 at 16:37











            • Ummm yeah I guess it is, should I post a new question? and mark this one as answered by you?

              – MEC
              Nov 20 '18 at 16:52











            • Yes, I think that's probably best if you are asking a whole new question. Thanks.

              – SJR
              Nov 20 '18 at 17:07











            • Whilst this may handle the error it doesn't really answer the question on how to catch the error and how to re-enable events after

              – Tom
              Nov 20 '18 at 17:57





















            • this worked great, can you help me with code to see if record exists and if so a msgbox to indicate YES or NO?

              – MEC
              Nov 20 '18 at 16:20











            • Quite possibly. Is this a separate question?

              – SJR
              Nov 20 '18 at 16:37











            • Ummm yeah I guess it is, should I post a new question? and mark this one as answered by you?

              – MEC
              Nov 20 '18 at 16:52











            • Yes, I think that's probably best if you are asking a whole new question. Thanks.

              – SJR
              Nov 20 '18 at 17:07











            • Whilst this may handle the error it doesn't really answer the question on how to catch the error and how to re-enable events after

              – Tom
              Nov 20 '18 at 17:57



















            this worked great, can you help me with code to see if record exists and if so a msgbox to indicate YES or NO?

            – MEC
            Nov 20 '18 at 16:20





            this worked great, can you help me with code to see if record exists and if so a msgbox to indicate YES or NO?

            – MEC
            Nov 20 '18 at 16:20













            Quite possibly. Is this a separate question?

            – SJR
            Nov 20 '18 at 16:37





            Quite possibly. Is this a separate question?

            – SJR
            Nov 20 '18 at 16:37













            Ummm yeah I guess it is, should I post a new question? and mark this one as answered by you?

            – MEC
            Nov 20 '18 at 16:52





            Ummm yeah I guess it is, should I post a new question? and mark this one as answered by you?

            – MEC
            Nov 20 '18 at 16:52













            Yes, I think that's probably best if you are asking a whole new question. Thanks.

            – SJR
            Nov 20 '18 at 17:07





            Yes, I think that's probably best if you are asking a whole new question. Thanks.

            – SJR
            Nov 20 '18 at 17:07













            Whilst this may handle the error it doesn't really answer the question on how to catch the error and how to re-enable events after

            – Tom
            Nov 20 '18 at 17:57







            Whilst this may handle the error it doesn't really answer the question on how to catch the error and how to re-enable events after

            – Tom
            Nov 20 '18 at 17:57















            1














            To answer the question about error handling:



            Public Sub MyProcedure()
            Application.EnableEvents = False

            On Error Goto ENABLE_EVENTS 'if any error occurs after this line events get enabled.

            'stuff where an error could occur

            ENABLE_EVENTS:
            Application.EnableEvents = True
            If Err.Number <> 0 Then
            MsgBox "an error occurred"
            End If
            End Sub


            For more information about error handling: VBA Error Handling – A Complete Guide.






            share|improve this answer
























            • Where do I place this code and do I have to call it from every Sub?

              – MEC
              Nov 20 '18 at 16:12











            • Everything you need to know about error handling is in that guide. Actually this is an example how you can use EnableEvents = False in your procedure and ensure it will always be re-enabled if an error occurs. That's nothing you can call from your sub, that's a how you do it in your sub.

              – Pᴇʜ
              Nov 21 '18 at 7:00


















            1














            To answer the question about error handling:



            Public Sub MyProcedure()
            Application.EnableEvents = False

            On Error Goto ENABLE_EVENTS 'if any error occurs after this line events get enabled.

            'stuff where an error could occur

            ENABLE_EVENTS:
            Application.EnableEvents = True
            If Err.Number <> 0 Then
            MsgBox "an error occurred"
            End If
            End Sub


            For more information about error handling: VBA Error Handling – A Complete Guide.






            share|improve this answer
























            • Where do I place this code and do I have to call it from every Sub?

              – MEC
              Nov 20 '18 at 16:12











            • Everything you need to know about error handling is in that guide. Actually this is an example how you can use EnableEvents = False in your procedure and ensure it will always be re-enabled if an error occurs. That's nothing you can call from your sub, that's a how you do it in your sub.

              – Pᴇʜ
              Nov 21 '18 at 7:00
















            1












            1








            1







            To answer the question about error handling:



            Public Sub MyProcedure()
            Application.EnableEvents = False

            On Error Goto ENABLE_EVENTS 'if any error occurs after this line events get enabled.

            'stuff where an error could occur

            ENABLE_EVENTS:
            Application.EnableEvents = True
            If Err.Number <> 0 Then
            MsgBox "an error occurred"
            End If
            End Sub


            For more information about error handling: VBA Error Handling – A Complete Guide.






            share|improve this answer













            To answer the question about error handling:



            Public Sub MyProcedure()
            Application.EnableEvents = False

            On Error Goto ENABLE_EVENTS 'if any error occurs after this line events get enabled.

            'stuff where an error could occur

            ENABLE_EVENTS:
            Application.EnableEvents = True
            If Err.Number <> 0 Then
            MsgBox "an error occurred"
            End If
            End Sub


            For more information about error handling: VBA Error Handling – A Complete Guide.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 20 '18 at 14:27









            PᴇʜPᴇʜ

            23.2k62950




            23.2k62950













            • Where do I place this code and do I have to call it from every Sub?

              – MEC
              Nov 20 '18 at 16:12











            • Everything you need to know about error handling is in that guide. Actually this is an example how you can use EnableEvents = False in your procedure and ensure it will always be re-enabled if an error occurs. That's nothing you can call from your sub, that's a how you do it in your sub.

              – Pᴇʜ
              Nov 21 '18 at 7:00





















            • Where do I place this code and do I have to call it from every Sub?

              – MEC
              Nov 20 '18 at 16:12











            • Everything you need to know about error handling is in that guide. Actually this is an example how you can use EnableEvents = False in your procedure and ensure it will always be re-enabled if an error occurs. That's nothing you can call from your sub, that's a how you do it in your sub.

              – Pᴇʜ
              Nov 21 '18 at 7:00



















            Where do I place this code and do I have to call it from every Sub?

            – MEC
            Nov 20 '18 at 16:12





            Where do I place this code and do I have to call it from every Sub?

            – MEC
            Nov 20 '18 at 16:12













            Everything you need to know about error handling is in that guide. Actually this is an example how you can use EnableEvents = False in your procedure and ensure it will always be re-enabled if an error occurs. That's nothing you can call from your sub, that's a how you do it in your sub.

            – Pᴇʜ
            Nov 21 '18 at 7:00







            Everything you need to know about error handling is in that guide. Actually this is an example how you can use EnableEvents = False in your procedure and ensure it will always be re-enabled if an error occurs. That's nothing you can call from your sub, that's a how you do it in your sub.

            – Pᴇʜ
            Nov 21 '18 at 7:00













            0














            I would first try to solve the problem by not allowing there to be a problem, if that fails then worry about error handling.



            Since you are already calling Worksheet_Change and using Data Validation, this checks the value of the validation cell. If it has a value in it then your code will run. If it is empty it will not. Data Validation clears the cell if someone types in it, so no matter what they type by the time it hits Worksheet_Change it should be an empty string.



            Private Sub Worksheet_Change(ByVal Target As Range)
            If Target.Address = "$F$2" Then ' Your Dropdown Validation Cell
            If Not Target.Value = "" Then
            Call Copy_From_Borrower_DBase
            End If
            End If
            End Sub





            share|improve this answer






























              0














              I would first try to solve the problem by not allowing there to be a problem, if that fails then worry about error handling.



              Since you are already calling Worksheet_Change and using Data Validation, this checks the value of the validation cell. If it has a value in it then your code will run. If it is empty it will not. Data Validation clears the cell if someone types in it, so no matter what they type by the time it hits Worksheet_Change it should be an empty string.



              Private Sub Worksheet_Change(ByVal Target As Range)
              If Target.Address = "$F$2" Then ' Your Dropdown Validation Cell
              If Not Target.Value = "" Then
              Call Copy_From_Borrower_DBase
              End If
              End If
              End Sub





              share|improve this answer




























                0












                0








                0







                I would first try to solve the problem by not allowing there to be a problem, if that fails then worry about error handling.



                Since you are already calling Worksheet_Change and using Data Validation, this checks the value of the validation cell. If it has a value in it then your code will run. If it is empty it will not. Data Validation clears the cell if someone types in it, so no matter what they type by the time it hits Worksheet_Change it should be an empty string.



                Private Sub Worksheet_Change(ByVal Target As Range)
                If Target.Address = "$F$2" Then ' Your Dropdown Validation Cell
                If Not Target.Value = "" Then
                Call Copy_From_Borrower_DBase
                End If
                End If
                End Sub





                share|improve this answer















                I would first try to solve the problem by not allowing there to be a problem, if that fails then worry about error handling.



                Since you are already calling Worksheet_Change and using Data Validation, this checks the value of the validation cell. If it has a value in it then your code will run. If it is empty it will not. Data Validation clears the cell if someone types in it, so no matter what they type by the time it hits Worksheet_Change it should be an empty string.



                Private Sub Worksheet_Change(ByVal Target As Range)
                If Target.Address = "$F$2" Then ' Your Dropdown Validation Cell
                If Not Target.Value = "" Then
                Call Copy_From_Borrower_DBase
                End If
                End If
                End Sub






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 20 '18 at 18:56

























                answered Nov 20 '18 at 16:53









                JosephCJosephC

                62310




                62310






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53393809%2fcatch-user-error-and-re-enable-application-events-after-error%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Tangent Lines Diagram Along Smooth Curve

                    Yusuf al-Mu'taman ibn Hud

                    Zucchini