+ Reply to Thread
Results 1 to 4 of 4

VBA--Does a File Exist

  1. #1
    Forum Contributor
    Join Date
    01-28-2008
    MS-Off Ver
    Excel 365
    Posts
    157

    VBA--Does a File Exist

    How can I use VBA in Excel to determine if a file with a known name exists in a known directory?
    Last edited by Ron Coderre; 10-29-2008 at 12:55 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please Login or Register  to view this content.
    Last edited by shg; 10-28-2008 at 01:03 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    01-28-2008
    MS-Off Ver
    Excel 365
    Posts
    157

    Smile

    I found that I can also use
    Dir ("Full path name")

    If this is the null string, the file does not exist. If the file does exist, Dir will equal the name of the file.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Sure. The LEN function is faster, but the result is the same.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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