+ Reply to Thread
Results 1 to 3 of 3

Not ending on an error

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    51

    Not ending on an error

    hey everyone,
    I need to know if there is a way to stop a macro from ending on an error. As of now, if there is any reporting errors that don't fit the layout of the .csv's it is reading, my macro will fail. I was wondering if there was a way to add in a few lines so if there is an error, it isn't fatal to my code. Any help is greatly appreciated
    I can't always post examples of what I might be asking about due to confidentiality issues, but I WILL try to explain my problems as thoroughly as I can.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Not ending on an error

    Maybe
    Please Login or Register  to view this content.
    This is not recommended because it will ignore the errors, you need to fix the error
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-10-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    51

    Re: Not ending on an error

    thats my biggest problem, if I could fix the error I would, but it's not in my code, it is in the files my codes read. I have a variable x defined, and there are some variants of that x missing in the files being read. I think if I use
    Please Login or Register  to view this content.
    and make it skip that variable x and move onto the next one my problem will be solved. I just don't know how to make it go back to a certain line number. For the most part, this error doesn't arise, it just happens that for this data, the last 3 days of the month encountered it.

    edit ***
    I tried using your logic. I put the on error resume next before the line i want it to resume at and on error goto 0 after the point where I'm getting the error. Does it sound like I'm using the syntax properly?
    Last edited by omgeokid; 02-14-2011 at 12:55 PM. Reason: my mistake

+ 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