Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Seo Services company Manchester

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-17-2005, 04:05 AM
ddiicc
Guest
 
Posts: n/a
Copy folder and paste to another folder

Please Register to Remove these Ads

Hi there,
Can anyone kindly tell me what is the script for the macro,
for copying a folder, then pasting and overwrite to another folder.

Pls help
Reply With Quote
  #2  
Old 07-17-2005, 05:05 AM
Bob Phillips
Guest
 
Posts: n/a
Re: Copy folder and paste to another folder

Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFolder "c:\mydocuments\*\*", "c:\tempfolder\", True


--
HTH

Bob Phillips

"ddiicc" <ddiicc@discussions.microsoft.com> wrote in message
news:D6753682-5B56-4905-B63C-AE513CFB3C63@microsoft.com...
> Hi there,
> Can anyone kindly tell me what is the script for the macro,
> for copying a folder, then pasting and overwrite to another folder.
>
> Pls help



Reply With Quote
  #3  
Old 07-17-2005, 05:05 AM
ddiicc
Guest
 
Posts: n/a
Re: Copy folder and paste to another folder

Thanks alot Bob..

"Bob Phillips" wrote:

> Dim oFSO As Object
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> oFSO.CopyFolder "c:\mydocuments\*\*", "c:\tempfolder\", True
>
>
> --
> HTH
>
> Bob Phillips
>
> "ddiicc" <ddiicc@discussions.microsoft.com> wrote in message
> news:D6753682-5B56-4905-B63C-AE513CFB3C63@microsoft.com...
> > Hi there,
> > Can anyone kindly tell me what is the script for the macro,
> > for copying a folder, then pasting and overwrite to another folder.
> >
> > Pls help

>
>
>

Reply With Quote
  #4  
Old 07-21-2005, 08:48 AM
karrde97 karrde97 is offline
Registered User
 
Join Date: 21 Jul 2005
Posts: 6
karrde97 is becoming part of the community
Question

I am trying to do the same thing except my source directory changes with each operation.

my_path2 = (source directory)
my_save2 = (target directory)

Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.copyfolder(my_path2, my_save2, True)


The directory gets copied except I get a Type mismatch error and my macro stops. I've tried all kinds of stuff and I can't get around the error.
Reply With Quote
  #5  
Old 07-21-2005, 09:47 AM
karrde97 karrde97 is offline
Registered User
 
Join Date: 21 Jul 2005
Posts: 6
karrde97 is becoming part of the community
Thumbs up

Nevermind. Looks like I had some issues with my string not being formatted correctly. Works perfect now. Bob, your code help get me back on track. Thanks!
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Forum Jump