Answers for "vba create folder if not exist"

VBA
3

vba create folder if not exist

'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
Posted by: Guest on May-21-2021
0

vba create directory if not exist

'Don't requires refernce of Microsoft Scripting Runtime
Path = "D:\FolderName\"
If Len(Dir(Path, vbDirectory)) = 0 Then
   MkDir Location
End If
Posted by: Guest on June-23-2021

Code answers related to "vba create folder if not exist"

Code answers related to "VBA"

Browse Popular Code Answers by Language