S
Saabster
Hi all,
It's always the simple stuff that trips you up I guess. Here is the
issue I'm dealing with.
I have a folder with 1400 excel files that I need to move to another
location. Since each file has to go in to a particular target folder I
decided that writing a program to move the files is they way to go.
I've got all but this last piece down. and for the life of me I can't
understand why the file.copy statement will not copy the file.
Try
If InStr(path, strTargetPath) Then 'We Found the Correct
Target Folder
MsgBox("Directory " & path & " Found!")
File.Copy(strSender, path & strTargetFile) ' Now copy
the file
End If
Catch
Console.WriteLine("Error.")
End Try
The copy appears to work when I step through the code, but when I check
the target folder the copied file is not there.
Can anyone tell me why this is happening (or not as the case is)? I
have verified that the source file exists, as well as the target folder
and there is no file with the same name in the target.
Please help. this is the last piece of the puzzle.
Thanks
Craig
It's always the simple stuff that trips you up I guess. Here is the
issue I'm dealing with.
I have a folder with 1400 excel files that I need to move to another
location. Since each file has to go in to a particular target folder I
decided that writing a program to move the files is they way to go.
I've got all but this last piece down. and for the life of me I can't
understand why the file.copy statement will not copy the file.
Try
If InStr(path, strTargetPath) Then 'We Found the Correct
Target Folder
MsgBox("Directory " & path & " Found!")
File.Copy(strSender, path & strTargetFile) ' Now copy
the file
End If
Catch
Console.WriteLine("Error.")
End Try
The copy appears to work when I step through the code, but when I check
the target folder the copied file is not there.
Can anyone tell me why this is happening (or not as the case is)? I
have verified that the source file exists, as well as the target folder
and there is no file with the same name in the target.
Please help. this is the last piece of the puzzle.
Thanks
Craig