+ Reply to Thread
Results 1 to 2 of 2

If file exists, run a particular macro, if it doesn't, look for another file

  1. #1
    Registered User
    Join Date
    12-18-2007
    Location
    London, UK
    MS-Off Ver
    MS Office 2007 & 2010
    Posts
    19

    Post If file exists, run a particular macro, if it doesn't, look for another file

    I have 6 files that all have a separate macro run on them on a daily basis.

    Rather than running them all individually, I want to run one macro, that will kick start all the others.

    However, of the 6 files, 1 or 2 may not be there every day and therefore I need to be able to bypass the search for them, if they are absent.

    e.g.

    Files are located in
    C:\Documents and Settings\My Documents\

    named:
    Book1.xls
    Book2.xls
    Book3.xls
    Book4.xls
    Book5.xls
    Book6.xls

    If Book1 is there, run macro "A", else, if Book2 is there, run macro "B", else, if book3 is there, run macro "C".......and so on.

    Can anyone tell me how I go about writing this?

    Many thanks

  2. #2
    Forum Contributor
    Join Date
    08-08-2005
    Location
    Kansas, USA
    MS-Off Ver
    2016
    Posts
    293

    Re: If file exists, run a particular macro, if it doesn't, look for another file

    Check out http://www.excelguru.ca/node/30

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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