erutherford
Active Member
- Joined
- Dec 19, 2016
- Messages
- 449
If the folder doesn't exit, the code functions fine creating a folder in the correct path. If the folder already exist, the If statement doesn't do its job. Its has to be something simple
Code:
Sub CreateFolder()
'Variable declaration
Dim sFolderPath As String
'Define Folder Path
sFolderPath = "C:\MyCar_Photos"
'Check Specified Folder exists or not
If Dir(sFolderPath) <> "" Then
'If folder is available
MsgBox "Folder exists!", vbInformation, "MyCar Photos"
Exit Sub
End If
MkDir sFolderPath
End Sub
[/code}