Be the first user to complete this post

  • 0
Add to List

FileSystemObject : FolderExists Method

Description: 

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

Format : 

objectOfFileSystemObject. FolderExists(foldername)

Arguments: 
  • 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”
            Else
                    strStatus = strCompleteFolderPath & “  folder does not exist”
           End If
        FnIsFolderExist = strStatus
End Function 

Msgbox FnIsFolderExist ("c:\New Folder")



Also Read:

  1. FileSystemObject : GetDriveName Method
  2. FileSystemObject : GetAbsolutePathName Method
  3. FileSystemObject : FileExists Method
  4. FileSystemObject : GetFile Method
  5. Excel-VBA : Insert Multiple Images from a Folder to Excel Cells
  6. FileSystemObject : CopyFolder Method
  7. FileSystemObject : CreateTextFile Method