Hi All,
I have below macro which creates a new directory on a network drive and then copies some files to the same directory. The directory name is as different every day as it also has date in it's name. I am able to create a new directory every day using the below macro but it doesn't allow me to copy the files from a different directory to the new created directory. Please help.
The Above macro gets stuck on the FileCopy Line.
Thanks a lot for your help in advance.
I have below macro which creates a new directory on a network drive and then copies some files to the same directory. The directory name is as different every day as it also has date in it's name. I am able to create a new directory every day using the below macro but it doesn't allow me to copy the files from a different directory to the new created directory. Please help.
Code:
Sub RunDownloadTool()
Dim filePath As String
Dim foldername As String
filePath = "[URL="file://\\OCS\Datadump\Daily\"]\\OCS\Datadump\Daily\[/URL]"
foldername = ThisWorkbook.Worksheets("Sheet1").Range("B1").Value
MkDir (filePath & foldername)
FileCopy "[URL="file://\\OCS\Datadump\Daily\REGO\AML.bat"]\\OCS\Datadump\Daily\REGO\AML.bat[/URL]", "[URL="file://\\OCS\Datadump\Daily\"]\\OCS\Datadump\Daily\[/URL]" & foldername & "\" & AML.bat
End Sub
Thanks a lot for your help in advance.