Bonjour Matthieu, Jean-Claude
En général, j'utilise ce code:
Code vba:
Private Declare Function SHCreateDirectoryEx Lib "Shell32.dll" Alias "SHCreateDirectoryExA" _
(ByVal hwnd As Long, ByVal pszPath As String, ByVal lngsec As Long) As Long
Private Sub CreationDossier(sNomRep As String)
'ChDrive "D"
SHCreateDirectoryEx 0&, sNomRep, 0&
End Sub
Private Sub Test()
Dim Rep As String
Rep = "C:\repA\repB\repC\RepD"
CreationDossier Rep
End Sub