Private Function MakeDir(Path As String) As Boolean
On Error GoTo Fel
Dim arr() As String, I As Integer, J As Integer, sTmp As String
Const NotAllowed As String = ":*?""<>|"
Path = Replace$(Path, "/", "\")
Path = Replace$(Path, "\\", "\")
If Right$(Path, 1) = "\" Then Path = Left$(Path, Len(Path) - 1)
For I = 1 To Len(NotAllowed)
If InStr(Mid$(Path, 3), Mid$(NotAllowed, I, 1)) <> 0 Then GoTo Fel
Next
arr = Split(Path, "\")
For I = 1 To UBound(arr)
sTmp = arr(0)
For J = 1 To I
sTmp = sTmp & "\" & arr(J)
Next
If Dir(sTmp, vbDirectory) = "" Then
MkDir sTmp
End If
Next
MakeDir = (Dir(Path, vbDirectory) <> "")
Fel:
End Function