Moving a file from one folder to another

  • Thread starter Thread starter scantor145
  • Start date Start date
S

scantor145

Excel 2002 with Visual Basic 6.3

I have a file, say it's called test.txt, in C:\. During the course o
running a particular macro I would like to find that file, move it an
save it to another folder, say C:\My Documents.

Any ideas for the procedure?

Thank
 
Hi Scantor
try this one:

Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")

FileCopy "c:\book1.xls","c:\My Documents\book1.xls" 'this one copy
fs.DeleteFile ("c:\book1.xls"), FORCE:=True 'this one delete

cheers
Miguel
 
Back
Top