ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying and renaming files on disk (https://www.excelbanter.com/excel-programming/289339-copying-renaming-files-disk.html)

Tim C

Copying and renaming files on disk
 
From within VBA, I need to copy files from one directory to another, and
then change some of the file extensions.

Any hints to get me started?

Thanks,
Tim C



Tom Ogilvy

Copying and renaming files on disk
 
sPath = "C:\MyDir1\"
sPath2 = "D:\MyFolder1\MyFolder2\"

Filcopy sPath & "myfile.xls", sPath2 & "Myfile.dat"

You can loop through the files using the code example for Dir
--
Regards,
Tom Ogilvy


Tim C wrote in message
...
From within VBA, I need to copy files from one directory to another, and
then change some of the file extensions.

Any hints to get me started?

Thanks,
Tim C





Tim C

Copying and renaming files on disk
 
Perfect! (except for the missing e : )

Thanks,
Tim C

"Tom Ogilvy" wrote in message
...
sPath = "C:\MyDir1\"
sPath2 = "D:\MyFolder1\MyFolder2\"

Filcopy sPath & "myfile.xls", sPath2 & "Myfile.dat"

You can loop through the files using the code example for Dir
--
Regards,
Tom Ogilvy


Tim C wrote in message
...
From within VBA, I need to copy files from one directory to another, and
then change some of the file extensions.

Any hints to get me started?

Thanks,
Tim C








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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com