|
-
Nov 15th, 1999, 05:05 PM
#1
Thread Starter
Frenzied Member
If you try to use the FileCopy statement on a currently open file, an error occurs.
Does anyone know how I can copy a file which may or may not be open?
This must be possible because you can do it in Windows Explorer
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Nov 15th, 1999, 10:16 PM
#2
Member
Use the objects provided by the Microsoft Scripting Runtime dll (FileSystemObject & File). Set a reference to Microsoft Scripting Runtime and try something like this:
Dim f as FileSystemObject
Dim fil as File
'instantiate file system object
Set f = New FileSystemObject
'set file reference
Set fil = f.GetFile(path)
'copy the file
fil.Copy(sDestination, Overwrite(True or False))
-
Nov 15th, 1999, 11:13 PM
#3
Thread Starter
Frenzied Member
OK! OK! you can all stop looking now!
The CopyFile API does the job
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|