Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    on error bypassed (2003)

    I have a loop macro but the on error commands are only working on the first loop.
    My code is designed to loop through a directory, open each file, unprotect the workbook, unhide a hidden sheet, copy a specific row of that to the master file in a designated spot and then move the file to a backup directory.
    OK, it works fine except for the two on error commands which only work on the first file.
    The first on error command is designed to account for three possible passwords which may apply to the source files.
    The second on error command is designed to account for a missing range (defined by the variable 'rge'). If a bad state or territory is entered in the source file then it will trigger here.

    Problem is that they work fine on the first file but after that the code breaks if either of these issues occur - the on error doesn't seem to work at all.

    I'm sure it's the way I've set up my loop, but everything else works fine.

    If you can help I'd appreciate your expertise.

    The code is in the attached text file called TedOz Code

    Thanks for your help!

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: on error bypassed (2003)

    Instead of:
    GoTo manualfile

    in your error handler, try:
    Resume manualfile

    Steve

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: on error bypassed (2003)

    Thank you very much - worked perfectly!

    Thanks for taking the time to go through my lengthy code and solve the issue!

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: on error bypassed (2003)

    <hr>Thanks for taking the time to go through my lengthy code and solve the issue! <hr>

    You are welcome, but, in all honesty, I can not take credit for going thru it all. Based on your symptoms, I looked at the most likely problem and suggested a fix...

    Steve

Posting Permissions

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