VBA判断目录是否存在的函数
分类:Excel
Function ExistsFile_UseFso(strPath As String) As Boolean
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
ExistsFile_UseFso = fso.FileExists(strPath)
Set fso = Nothing
End Function
Function FolderExists_UseFso(strPath As String) As Boolean
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
FolderExists_UseFso = fso.FolderExists(strPath)
Set fso = Nothing
End Function