Moving a disk file with VBA
Chris, you can call the following function or just insert the "FileCopy" line
where you want it and replace the arguments with the full paths (i.e. drive,
path, file name, file extension):
Public Function FileCopy(argFullSourceName As String, argFullDestinationName
As String)
'COPY A CLOSED FILE FROM ONE FOLDER TO ANOTHER;
FileCopy argFullSourceName, argFullDestinationName
End Function
HTH
"Chris Ferguson" wrote:
Hi
Can someone point me in the right direction please.
I want to copy an access database from one disk location to another using
VBA.
The reason for this is that I have an odbc link to a database and I want to
use it to read a different database without having to rebuild the query. I
have found that for me the easiest way to do this is to copy the live
database into a temporary location which msquery can read, then to change
the database just copy the new database over the top. But I want to do this
all from within excel.
So any pointerswould be appreciated.
Many Thanks
Chris
|