• Trouble with Err.Source (Excel 2003)

    Author
    Topic
    #398897

    hello Loungers

    Can anyone test this for me on Excel < 2003?!

    MsgBox "An Error Occured." & Chr(13) & Chr(13) & _
    "Please call the Developer of this application and give him the following" & _
    " Information:" & Chr(13) & Chr(13) & _
    "Error Number: " & Str(Err.Number) & Chr(13) & _
    "Error Message: " & Err.Description & Chr(13) & Chr(13) & _
    "Error Source: " & Err.Source & Chr(3) & Chr(3) & _
    "This application will terminate now.", vbCritical + vbOKOnly, "Error Encountered"

    No matter what I did I could not get the line “This application will terminate now.” to go on a line by itself.

    Thanks for trying

    Viewing 0 reply threads
    Author
    Replies
    • #766374

      Did you try changing the line:

      “Error Source: ” & Err.Source & Chr(3) & Chr(3) & _

      to

      “Error Source: ” & Err.Source & Chr(13) & Chr(13) & _

      – that works for me on the code you posted.

      • #766375

        thankyou Brooke

        It was my mistake, I should have looked closer to my typing, and then deleted the message.

        Thanks for being my “spare” eyes eyeout

        Wassim

        • #766450

          Anything wrong with using vbNewLine in stead of chr(13) ?

          • #766604

            hello Jan Karel

            I guess the force of habit has so much inertia that it sustains all attempts to change. I have stuck with CHR(13) since my early days with VBA, and its too late to change. drop newbrain

            But you do have a point, because it does make the code more readable.

            Wassim

          • #766605

            hello Jan Karel

            I guess the force of habit has so much inertia that it sustains all attempts to change. I have stuck with CHR(13) since my early days with VBA, and its too late to change. drop newbrain

            But you do have a point, because it does make the code more readable.

            Wassim

        • #766451

          Anything wrong with using vbNewLine in stead of chr(13) ?

      • #766376

        thankyou Brooke

        It was my mistake, I should have looked closer to my typing, and then deleted the message.

        Thanks for being my “spare” eyes eyeout

        Wassim

    Viewing 0 reply threads
    Reply To: Trouble with Err.Source (Excel 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: