ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Move and rename a file (https://www.excelbanter.com/excel-programming/381987-move-rename-file.html)

Peter[_61_]

Move and rename a file
 
Calling all Excel programming brains,

I am trying to move and rename a file but don't know where to start,
can anybody help?

Thanks,
Peter


Martin Fishlock

Move and rename a file
 
There are at least two direct methods for copying a file:

FileCopy SourceFile, DestinationFile

CopyFile Method

Have a look at both and try them out.
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Peter" wrote:

Calling all Excel programming brains,

I am trying to move and rename a file but don't know where to start,
can anybody help?

Thanks,
Peter



Tom Ogilvy

Move and rename a file
 
name "C:\Myfolder1\Myfile1.xls" as "C:\Myfolder2\Sub1\Report1.xls"

Name oldpathname As newpathname

see VBA help on the Name STATEMENT.


--
Regards,
Tom Ogilvy


"Peter" wrote:

Calling all Excel programming brains,

I am trying to move and rename a file but don't know where to start,
can anybody help?

Thanks,
Peter




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

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