Vba - Création de dossier
Rédigé par Xpress
Aucun commentaire
Classé dans : Vba
On défini les variables CheminGeneral = "R:'Dossier" Dim fso, file Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Puis création des dossiers, seulement s'ils n'existent pas déjà : Dim sFolderPath As String sFolderPath = (CheminGeneral & "NomDossier") If Right(sFolderPath, 1) <> "" Then sFolderPath = sFolderPath & "" End If If Dir(sFolderPath, vbDirectory) <> vbNullString Then ' MsgBox "Folder exist", vbInformation, "NomDossier" Else 'MsgBox "Folder doesn't exist", vbInformation, "NomDossier" MkDir (CheminGeneral & "NomDossier") End If