Question : vba create folder if not exist
Answered by : vastemonde
'requires reference to Microsoft Scripting Runtime
Function MkDir(ByVal strDir As String, ByVal strPath As String) Dim fso As New FileSystemObject Dim path As String path = strPath & strDir If Not fso.FolderExists(path) Then fso.CreateFolder path End If
End Function
Source : https://stackoverflow.com/questions/43658276/create-folder-path-if-does-not-exist-saving-issue | Last Update : Fri, 28 May 21
Question : vba create directory if not exist
Answered by : faizan-younas-tanooli
'Don't requires refernce of Microsoft Scripting Runtime
Path = "D:\FolderName\"
If Len(Dir(Path, vbDirectory)) = 0 Then MkDir Location
End If
Source : | Last Update : Wed, 30 Jun 21