CopyFolder

N

Neil

I have looked at the copyfolder method, but cant seem to
get it to work, can anyone tell me the code to copy
c:\test1\*.* and all its sub folders to c:\test2\*.* ?

Many thanks in advance.

This is a good newsgroup BTW.

Neil
 
T

Tom Ogilvy

Your second argument should be

c:\test2\

without the wildcards.

See the help on filecopy - it is pretty clear on what is required and what
the behavior is.

Regards,
Tom Ogilvy
 
N

neil

Thanks Tom,
I am trying the following code...

FileSystemObject.CopyFolder "c:\test1\*", "c:\test2\"

im not sure exactly what FileSystemObject is and if I am
using it correctly....

Neil
 
T

Tom Ogilvy

Sub tester2()
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFolder "c:\Test1", "c:\Test2"

End Sub


Worked for me in Excel 2000 on Windows 2K

Regards,
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top