+ Reply to Thread
Results 1 to 4 of 4

default error handling mechanism

Hybrid View

  1. #1
    Registered User
    Join Date
    06-21-2007
    Location
    Vancouver, Canada
    Posts
    74

    default error handling mechanism

    I have a segment of code that contains

    public sub someroutine('parameters)
    
            on error goto localErr
    
            'some code
    
    localErr:
           ' show the default error message
    exit sub
    
    end sub
    How do I show the default error message within the subroutine?

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I'm not sure what you want. If you want the system to throw an error, the Raise method is what you are looking for.

    If not, a fuller explaination would be helpful.

  3. #3
    Registered User
    Join Date
    06-21-2007
    Location
    Vancouver, Canada
    Posts
    74
    I think I'm looking for the Raise method, although I've already figured out what the problem was. Thanks for your help.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,664
    Perhaps
    If Err <> 0 Then MsgBox Err.Number & vbLf & Err.Description

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1