#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default CopyFolder

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default CopyFolder

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


"Neil" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default CopyFolder

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

-----Original Message-----
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


"Neil" wrote in message
...
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



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default CopyFolder

An additional comment:

If you are using a UNC path with copyfolder, see this article:

http://support.microsoft.com/default...b;en-us;251339
PRB: CopyFolder Syntax Is Different for UNC Paths and Mapped Drive Paths

--
Regards,
Tom Ogilvy

"Neil" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default CopyFolder

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


"neil" wrote in message
...
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

-----Original Message-----
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


"Neil" wrote in message
...
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



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"