1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Sub UsingFileSystemObject1()
Dim fso As Scripting.FileSystemObject
Dim NewPath As String
Dim FolderPath As String
Dim Fil As Scripting.File
FolderPath = "D:\Dossiers"
NewPath = "D:\Fichiers"
Set fso = New Scripting.FileSystemObject
If Not fso.FolderExists(NewPath) Then
fso.CreateFolder NewPath
End If
If fso.FileExists(FolderPath & "\ Article sans code 2020.xlsx") Then
Set Fil = fso.GetFile(FolderPath & "\ Article sans code 2020.xlsx")
Debug.Print Fil.Name, Fil.Path, Fil.DateCreated, Fil.Size, Fil.Type
Fil.copy NewPath&"\Article sans code 2020.xlsx")
End If
End Sub |
Partager