Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Unwanted Exit (VB 6.0)

    Once in a while a VB program I developed all of a sudden closes without any action on the operator's part. Any suggestions as to what would make a program do this without any resulting error message or other indication? It just quits and drops you right back to the desktop.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 18 Times in 18 Posts

    Re: Unwanted Exit (VB 6.0)

    This usually means that there is an unhandled error somewhere in the code. In a compiled program, you can't activate the de######, so an unhandled error causes the program to terminate. All major routines in your program should have error handling.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Unwanted Exit (VB 6.0)

    Hi Hans,

    My goodness! That was a prompt response. I'll go back and check my error handler code -- I may have left one out somewhere. Unfortunately, this error is intermittent which means it is hard to detect and debug.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Unwanted Exit (VB 6.0)

    You might also look for an End statement. These are sometimes left over inadvertently when editing an If...End If (or similar construct). Because they don't cause compilation errors, they can be hard to spot.

  5. #5
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Unwanted Exit (VB 6.0)

    I'll check for those although I think the compile function usually finds unmatched End statements.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 18 Times in 18 Posts

    Re: Unwanted Exit (VB 6.0)

    End as a statement by itself doesn't need to be matched with anything else (unlike End With, End For etc.). End quits execution abruptly.

  7. #7
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Unwanted Exit (VB 6.0)

    Thanks Hans,

    I'm going to check every End statement I've got.

Posting Permissions

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