Hi,
you could use the filesystemobject, example:
Code:
Public Function MoveFile(strFile As String, strLoc As String) As Boolean
On Error GoTo Err_MoveFile
Dim fsoImport As Object
Dim floImportFile As Object
Set fsoImport = CreateObject("Scripting.FileSystemObject")
Set floImportFile = fsoImport.GetFile(strFile)
If strFile <> strLoc Then
floImportFile.Move strLoc
End If
MoveFile = True
Exit_MoveFile:
Set fsoImport = Nothing
Set floImportFile = Nothing
Exit Function
Err_MoveFile:
MoveFile = False
Debug.Print Err.Number & ": " & Err.Description
Resume Exit_MoveFile
End Function
The code can be called as follows:
movefile("C:\mydata\myfile.txt","C:\test\myfile.tx t")
greetings
NG