Method: FolderExists for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: FolderExists for FileSystemObject
Method: FolderExists for FileSystemObject
Checks whether a folder exists
bFolderExists = Object.FolderExists(FolderSpec)
| Object | FileSystemObject Object with this method |
| FolderSpec | String Specifies the path of the folder. |
| bFolderExists | Boolean If the folder exists, the value is True. If the folder does not exist, the value is False. |
The following example checks whether a folder exists:
Function FolderStatus(sFolder) Dim fso, sOutput Set fso = CreateObject("Scripting.FileSystemObject") If (fso.FolderExists(sFolder)) Then sOutput = sFolder & " exists." Else sOutput = sFolder & " doesn't exist." End If FolderStatus = sOutput End Function