+ Reply to Thread
Results 1 to 3 of 3

macro for checking if file exists

  1. #1
    Registered User
    Join Date
    03-09-2011
    Location
    San Francisco , CA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Smile macro for checking if file exists

    Hi Folks
    I have an Excel Macro that looks for 4 files and modifies them like this :

    Please Login or Register  to view this content.
    Problem is that if F1 is NOT present , it ends with error.I'd like to do something so that , whether F1 is found or not it will STILL check for F2 ..F4 . Same stuff for F2..F4
    Finally I would like to Rename the file with this naming convention
    Rename F1xls to YYYYMMDD_F1.xls
    then invoke a zip program ( Its already there in my directory called zip.exe and i know the command line arguments to it ) to zip each file.
    Thank You ,so so ,much

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro for checking if file exists

    Hi sieger007
    See this link to check for existence of file or folder http://www.excelguru.ca/node/30
    Or you could try
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: macro for checking if file exists

    Maybe like this:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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