excel vba if folder exists

The solution for “excel vba if folder exists” can be found here. The following code will assist you in solving the problem.

‘Input parameters
‘@Param strFileFullPath: String. Full path to the folder.
‘Local path example: “C:/myFolder”
‘SharePoint path example: “\\my.sharepoint.com\Shared%20Documents”
‘Local network path example: “\\SOMEONES-PC\Users\Public\Documents”
‘Output Parameters
‘@Param FolderExists: Boolean.
Function FolderExists(strFolderPath As String) As Boolean

Dim objFSO As Object
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
If objFSO.FolderExists(strFolderPath) Then FolderExists = True
Set objFSO = Nothing

End Function

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts