eliW
Well-known Member
- Joined
- Mar 2, 2002
- Messages
- 1,940
Hi all,
I am trying to copy files from a folder and subfolders to another destination according to list in first column of a worksheet.
BTW, the list contains full path and file name like this:
Exexcuting this macro gives me a constant error on the red line saying:
Any help will be apreciated,
Eli
I am trying to copy files from a folder and subfolders to another destination according to list in first column of a worksheet.
BTW, the list contains full path and file name like this:
HTML:
713It's My Party -Lesley Gore.mp3 F:\A04
714Sleep walk -Santo and Johnny.mp3 F:\A04
PHP:
Run Time Error 70
Permission Denied
Code:
Sub copyfiles()
[COLOR="#00FF00"]'copy files from folder and subfolders to another folders[/COLOR]
Dim m, x As Variant
Dim Copier
Dim FileName As String
Dim FileType As String
Dim FilePath As String
'On Error Resume Next
m = Range("A1").CurrentRegion.Count
Set Copier = CreateObject("Scripting.FileSystemObject")
For x = 1 To m
FileName = Cells(x, 1).Value
FilePath = Cells(x, 2).Value
[COLOR="#00FF00"]'Copier.copyfile "C:\Users\User\Desktop\rivka\" & FileName, [/COLOR]"C:\Users\User\Desktop\songs\"
[COLOR="#FF0000"]Copier.copyfile FilePath & "\" & FileName, "C:\Users\User\Desktop\jjj"[/COLOR]
[COLOR="#00FF00"]'Copier.copyfile FileName, "C:\Users\User\Desktop\jjj"[/COLOR]
Next
MsgBox ("done")
'
End Sub
Any help will be apreciated,
Eli