How to Check whether a Folder Exists or Not in a Specific Path
Suppose If we want to Create a Folder with Name as "TestFolder" only if it does not exist in the Specified Path , we can use the Len function along with the IF Condition to check the Folder existence then we use the MkDir keyword to create a folder as per below
If Len(Dir("C:\Users\Tamatam\Desktop\Reports\TestFolder", vbDirectory)) = 0 Then
MkDir "C:\Users\Tamatam\Desktop\Reports\TestFolder"
End If
Thanks,
TAMATAM
Suppose If we want to Create a Folder with Name as "TestFolder" only if it does not exist in the Specified Path , we can use the Len function along with the IF Condition to check the Folder existence then we use the MkDir keyword to create a folder as per below
If Len(Dir("C:\Users\Tamatam\Desktop\Reports\TestFolder", vbDirectory)) = 0 Then
MkDir "C:\Users\Tamatam\Desktop\Reports\TestFolder"
End If
Thanks,
TAMATAM
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.