Syntax for copying a file from one folder to another

Z

Zamdrist

Seems simple, but how - filename also has blank characters.

Shouldn't be a problem, are you using the FileSystemObject? Have you
written any code?

Thanks,

Steve
 
J

Jim Pockmire

Yes, but I don't know what to substitute for FileSystemObject e.g. I am
using

FileSystemObject.CopyFile "C:\MyFile" "C:\Temp\"

...which produces an error
 
Z

Zamdrist

Yes, but I don't know what to substitute for FileSystemObject e.g. I am
using

FileSystemObject.CopyFile "C:\MyFile" "C:\Temp\"

..which produces an error

This is what you need to do, complete with spaces in the filename
even:

Dim Fso As New Scripting.FileSystemObject
Fso.CopyFile "C:\Copy of imageonly.txt", "C:\temp\"
 
Z

Zamdrist

Even this is producing an error "User-defined type not defined"

That is because you need to make a reference to it in the VBA editor.
Tools/References/Browse, and choose c:\windows\system32\scrrun.dll
(Microsoft Scripting Runtime)
 
J

Jim Pockmire

I'm not sure this is going to work, as I am deploying the app to other users
who won't know how to
 
J

Jim Pockmire

I'm not sure this is going to work as I am deploying the app to other users
and they won't know how to do this.

Thanks,
 
Top