Hello:
I know how to copy files from one folder to another folder using Windows Scripting Host. It is quite simple:
___________________________
strPathToCustomerInputTemplate = "C:\Users\" & UserNameWindows() & "\Documents\CustomerUpdates_Before"
strPathToCustomerOutputTemplate = "C:\Users\" & UserNameWindows() & "\Documents\CustomerUpdates_After"
Set FSO = CreateObject("scripting.filesystemobject")
FSO.CopyFolder Source:=strPathToCustomerInputTemplate, Destination:=strPathToCustomerOutputTemplate
__________________________
I could not find a function in Excel VBA that can copy all files in a folder to another folder without using the DIR command and looping. Is there a comparable native VBA command to do the same thing?
Thanks,
Rich Locus
Copying Files From One Folder To Another
-
- 2StarLounger
- Posts: 168
- Joined: 03 Oct 2015, 00:30
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Copying Files From One Folder To Another
No; the VBA command FileCopy does not support wildcards.
Best wishes,
Hans
Hans