Palabras clave: FSO, averiguar, saber, directorio, folder, carpeta
Autor: Xavi
Extraído de: Centro de desarrollo de Office
Objetivo
Averiguar si un directorio existe mediante FSO. Es la alternativa a Dir(strFolder, vbDirectory)
Public Function ExistsFolder(strFolder As String) As Boolean
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
If fso.FolderExists(strFolder) = False Then
ExistsFolder = False
Else
ExistsFolder = True
End If
If Err <> 0 Then
ExistsFolder = False
End If
Set fso = Nothing
End Function