Results 1 to 5 of 5

Thread: Error Handling? (Runtime 75)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2006
    Posts
    24

    Error Handling? (Runtime 75)

    Hey,

    I havn't been here for years, and i've only just now got Visual Basic back onto my computer for something different. I am just creating a little program to find and replace text. It's a very simple program, and I am having trouble finding how to handle the runtime error 75 that occurs. My command button loads a file into the RTC (Rich Textbox), and when the file doesn't exist I want it to give a Msg or similar, but it just errors and crashes. What do I need to put for the error handling??

    Thanks in advance,

    Matt

  2. #2

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Error Handling? (Runtime 75)

    A general error handler may look similar to this:
    Code:
    Private Sub Command1_Click()
    
    On Error GoTo ErrHandler
    
        'main code goes here
    
        Exit Sub
    
    ErrHandler:
    
        'you may have select case err.Number here
        'or Err.Clear
        'you may also (if necessary) display message box with err.description (MsgBox Err.Description)
        'and/or Resume or Resume Next
        'and/or Exit Sub 'or function
    
        'etc, etc, etc...
    
    End Sub

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2006
    Posts
    24

    Re: Error Handling? (Runtime 75)

    Thanks guys, it helped heaps.

  5. #5
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Error Handling? (Runtime 75)

    Additional reference http://www.vbforums.com/showthread.p...17#post3331617

    Please don't forget to mark the thread as resolved if you have no follow-up questions.

Posting Permissions

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



Click Here to Expand Forum to Full Width