ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File systems (https://www.excelbanter.com/excel-programming/303316-file-systems.html)

nath

File systems
 
Hi

I have code in order to look at all the files within a
given path. I would like to know how to copy and paste
files, i.e. make a copy of a file. From excel using VBA

TIA


Nathan.

Jim Rech

File systems
 
Check out the FileCopy statement in VBA help.

--
Jim Rech
Excel MVP
"nath" wrote in message
...
| Hi
|
| I have code in order to look at all the files within a
| given path. I would like to know how to copy and paste
| files, i.e. make a copy of a file. From excel using VBA
|
| TIA
|
|
| Nathan.



Bob Phillips[_6_]

File systems
 
Hi Nathan,

Trythis

Dim FSO As Object
Dim oFile As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.GetFile("c:\myTest\volker1.xls")
oFile.Copy ("c:\myTest\Copy of Volker1.xls")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"nath" wrote in message
...
Hi

I have code in order to look at all the files within a
given path. I would like to know how to copy and paste
files, i.e. make a copy of a file. From excel using VBA

TIA


Nathan.





All times are GMT +1. The time now is 06:56 PM.

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