I think there r two Problems in this code.
1)U can't say whether the File Exist in specific Path or not.
if the file doesn't exist in specific Path then U will get a runtime error. for Both
Statement.
2)the requirement is to copy the file, not to move the file so the Kill statement is
not required
It is fairly simple to check whether the source/dest files exist before attempting the copy. It's well worth learning about FileSystemObject, as it provides much more functionality than the built-in commands. But it's not always necessary.
Also, I think it was nice of cbbibleboy to throw in the extra code demonstrating how to zap the original file if required. However, it might have been nice to make a more prominent note about what/why, to avoid disasters.
Oh, one other thing I'm curious about. What's the idea with the "//"? It doesn't compile under VB6. Is it...
- from a different (probably later) version of VB?
- from a different language, and shouldn't really be there?
- intended to prevent accidental execution?
- other?