Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Copy folder and paste to another folder

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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" wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy folder and paste to another folder


I am trying to do the same thing except my source directory changes wit
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 m
macro stops. I've tried all kinds of stuff and I can't get around th
error

--
karrde9
-----------------------------------------------------------------------
karrde97's Profile: http://www.excelforum.com/member.php...fo&userid=2546
View this thread: http://www.excelforum.com/showthread.php?threadid=38782

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy folder and paste to another folder


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!


--
karrde97
------------------------------------------------------------------------
karrde97's Profile: http://www.excelforum.com/member.php...o&userid=25461
View this thread: http://www.excelforum.com/showthread...hreadid=387823

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? Subteam Excel Discussion (Misc queries) 2 May 7th 06 08:14 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 03:28 PM
How to copy 30 csv files from a folder to another folder ddiicc Excel Programming 1 July 17th 05 09:42 AM
VBA to copy and paste folder Ronaldo Excel Programming 6 November 3rd 04 02:29 PM
Create Folder / Copy Folder / Replace Murray Outtrim[_2_] Excel Programming 0 February 24th 04 06:40 PM


All times are GMT +1. The time now is 04:52 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"