FileSystemObject : FolderExists Method


Returns True if a specified folder exists; False if it does not.

Format : 

objectOfFileSystemObject. FolderExists(foldername)

  • objectOfFileSystemObject
    • As the names says, it’s a FileSystemObject.
    • foldername
      • Mandatory
      • Type:     String
      • Folder , whose existence to be determined.


Function FnIsFolderExist(strCompleteFolderPath)
      Set fso = CreateObject("Scripting.FileSystemObject")
      If fso. FolderExists(strCompleteFolderPath)Then
                    strStatus = strCompleteFolderPath & “  folder exists”
                    strStatus = strCompleteFolderPath & “  folder does not exist”
           End If
        FnIsFolderExist = strStatus
End Function 

Msgbox FnIsFolderExist (“c:\New Folder”)


2 thoughts on “FileSystemObject : FolderExists Method”

  1. I have the folder keywords in column A, Directory( Path) in column B. I need a a macro that search for the folder with keyword in the directory and output the folder present/ folder not present in column C and if present it should output modified date of that folder in column D.

    Column A: 20140605
    Directory(Path)- \\nasmsb1\ap\ISBPRO\Atwater\IMPORT\HISTORY\DMV_CASB_RO_R60_PLATE_Errors

    Column C: Folder present/ Folder not present ( Expected output)
    Column D: 5/6/2014 11:25 PM

    I need a macro with loop( iteration)

    Thanks in advance for your help

    • It sudnt take much time I guess. Get the rows count using usedrange.rows.count …iterate the rows, get the path from column A ..check the folder and display the status to the corresponding rows. Keep iterating.
      Do let me know if u face any prob..I will provide the entire implementation.


Leave a Comment