#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default File Copy

look in help for copyfile.

If is part of the filesystemobject in the scripting runtime.

If the files are closed, you can use the built in VBA command filecopy.

from help

Copies a file.

Syntax

FileCopy source, destination

The FileCopy statement syntax has these named arguments:

Part Description
source Required. String expression that specifies the name of the file to be
copied. The source may include directory or folder, and drive.
destination Required. String expression that specifies the target file name.
The destination may include directory or folder, and drive.
Remarks

If you try to use the FileCopy statement on a currently open file, an error
occurs.

-------------
The example:

This example uses the FileCopy statement to copy one file to another. For
purposes of this example, assume that SRCFILE is a file containing some
data.

Dim SourceFile, DestinationFile
SourceFile = "SRCFILE" ' Define source file name.
DestinationFile = "DESTFILE" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.

--
Regards,
Tom Ogilvy



Neil wrote in message
...
My last post for today, thank you to everyone that has
replied to the few questions I have posted...

I am using the MSOfilepicker object to put up a box from
which the user can select some files, I then have an item
call vrtselecteditems, at least i thinks thats what it
was called, I would like to copy all the sleected files
from vrtselected items to a target dir called foldername,

I have looked in the help, but I cant seem to pin it
down, are there different dgrees of help files ? The help
I have installed seems pretty limited, either that or im
using it incorrectly :(





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
copy data for match word from one file to another file mishak Excel Worksheet Functions 1 December 2nd 09 02:11 AM
How do I copy a excel file into a InDesign file correctly? cfb Excel Discussion (Misc queries) 2 June 14th 07 10:08 PM
copy the same raws of all sheets from about a 100 file to a new sheet of a book and save the file [email protected] Setting up and Configuration of Excel 0 March 14th 07 02:13 AM
How do I copy a file and attach a date to the name of the file hccatmo Excel Discussion (Misc queries) 1 February 23rd 07 08:21 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM


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

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"