Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Trouble with Err.Source (Excel 2003)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> 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 <font color=blue>"This application will terminate now."</font color=blue> to go on a line by itself.

    Thanks for trying
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Trouble with Err.Source (Excel 2003)

    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.

  3. #3
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Trouble with Err.Source (Excel 2003)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Brooke

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

    Thanks for being my "spare" eyes <img src=/S/eyeout.gif border=0 alt=eyeout width=15 height=15>

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Trouble with Err.Source (Excel 2003)

    Anything wrong with using vbNewLine in stead of chr(13) ?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Trouble with Err.Source (Excel 2003)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> 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. <img src=/S/drop.gif border=0 alt=drop width=23 height=23> <img src=/S/newbrain.gif border=0 alt=newbrain width=21 height=22>

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

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

Posting Permissions

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