+ Reply to Thread
Results 1 to 6 of 6

Error in Code - Error Handler

  1. #1
    Registered User
    Join Date
    07-29-2010
    Location
    Multan
    MS-Off Ver
    Excel 2010
    Posts
    38

    Error in Code - Error Handler

    Hi everyone

    I have found a code from this forum to import text file, modified it to my need, but stuck on error handling . On error it still adds new sheet , and on No Error it still shows error handler message

    Can any one correct it for me

    following is the code
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    08-06-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Error in Code - Error Handler

    At the end of your code put this

    Please Login or Register  to view this content.
    That will fix one of your problems.

    In regards to the sheet being added it would depend where the error occurs. May I suggest you run this by tapping the F8 key. This will allow you to progress through the code line by line and will raise any issues and show you where it's occuring. Let me know if you need any more help

  3. #3
    Registered User
    Join Date
    07-29-2010
    Location
    Multan
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Error in Code - Error Handler

    Many thankx . for error handler , it worked

    It adds new sheet, when i try to import same file for second time after this code

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-06-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Error in Code - Error Handler

    Please Login or Register  to view this content.
    Give this a go instead of

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-29-2010
    Location
    Multan
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Error in Code - Error Handler

    ;-(

    On importing same file for second time, it generates error, clears it, add new sheet and import the file

  6. #6
    Registered User
    Join Date
    08-06-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Error in Code - Error Handler

    Are you running this code each time you want to import a file? can you explain exactly what the outcome you're after with this bit please. If you wanted to import the same thing twice then maybe just copying the tab would be better?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Getting Run-time Error 91. Error handler not working.
    By rbs123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2014, 04:20 AM
  2. Error Handler Help for Code that Copies a sheet to a new workbook
    By caliskier in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2014, 12:47 PM
  3. Error Handler for Run-time error '9'
    By josnah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2006, 01:17 PM
  4. Replies: 1
    Last Post: 02-08-2006, 06:25 AM
  5. [SOLVED] Error Handler and Error 1004
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2005, 10:06 AM

Tags for this Thread

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