Copy Method

J

Jim Pockmire

How do I use it - not sure what needs to be declared or how things are
defined? - need to copy a file from one folder to another

Object.Copy destination
 
M

Marshall Barton

Jim said:
How do I use it - not sure what needs to be declared or how things are
defined? - need to copy a file from one folder to another

Object.Copy destination


Forget that and use the FileCopy statement instead.
 
J

Jim Pockmire

I need some help with the syntax, e.g. if I wanted to copy "C:\MyFile.txt"
to "C:\Temp\" what would the code be?
 
R

Rick Brandt

Jim said:
I need some help with the syntax, e.g. if I wanted to copy
"C:\MyFile.txt" to "C:\Temp\" what would the code be?

FileCopy "C:\MyFile.txt", "C:\Temp\MyFile.txt"

Functions like this *are* explained in the help file.
 
J

Jim Pockmire

Everything I have seen requires the use of the "FileSystemObject" which also
requires a reference to the "Scripting" library.

Is there not an easier way as I will be deploying this app to users who will
be unfamiliar with the process.

Where is the DOS copy command when you need it?
 
D

Dirk Goldgar

Jim Pockmire said:
Everything I have seen requires the use of the "FileSystemObject"
which also requires a reference to the "Scripting" library.

Is there not an easier way as I will be deploying this app to users
who will be unfamiliar with the process.

Where is the DOS copy command when you need it?

The FileCopy statement is native to VBA and doesn't require a reference
to the Scripting library.
 
Top