+ Reply to Thread
Results 1 to 2 of 2

Ignore error while opening Excel workbook

  1. #1
    Registered User
    Join Date
    01-26-2016
    Location
    Bahrain
    MS-Off Ver
    2007
    Posts
    1

    Ignore error while opening Excel workbook

    I've an Excel VBA Code, that Code will Merge All Excel Files located in one folder. I need that Code to ignore any files that does not open for one reason or another like, the file is corrupted or not compatible or ....

    the code is :

    Please Login or Register  to view this content.
    I'm thinking of something similar to "if statement", if the file could be opened and read from excel go ahead, other wise go next file in that directly.

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Ignore error while opening Excel workbook

    The line: "On Error Resume Next" will ignore any error and move to the next line (often ill-advised, but occasionally useful).

    Remember to "turn that off" with the line: "On Error Got 0" at the end of the code that you do not want that effect.
    <---If my answer helped, please click *

+ 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. Replies: 2
    Last Post: 05-31-2014, 02:05 AM
  2. Run time error 13, when VBA workbook opening in excel 2007
    By wkslee99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 03:37 AM
  3. Error opening excel workbook
    By mrblack12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2013, 08:56 AM
  4. compile error message on a new excel workbook opening
    By manicmollymacomb in forum Excel General
    Replies: 0
    Last Post: 03-03-2006, 06:10 PM
  5. [SOLVED] Error when opening Excel workbook
    By dcournoyer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-01-2006, 10:55 AM
  6. [SOLVED] Ignore workbook_open() when opening workbook next time
    By gublues in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2006, 08:30 PM
  7. Error Opening an Excel Workbook
    By [email protected] in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-24-2005, 11:05 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