Thanks to Uffe Kousgaard and Peter Horsbøll Møller for their
suggestions. I had considered using a pause as suggested by Uffe, but I
thought there must be a better way. Peter provided solution that
utilised a Windows API function, and it works beatifully. Thanks again.
Peter's solution is as follows:
Declare Function APICopyFile(ByVal sIn, ByVal sOut As string, ByVal n As
integer) As Logical
Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" ( ByVal
lpExistingFileName As String, ByVal lpNewFileName As String, ByVal
nFailIfExists As Integer) As Logical
'-------------------------------------------
'CopyFile--- example: Call APICopyFile(Inputfile,Outputfile,n)
'n : If True (nonzero), the function will fail if the destination file
already exists.
'Otherwise the destination file will be overwritten.
'-------------------------------------------
Function APICopyFile(ByVal sIn, ByVal sOut as string, ByVal n as
integer) As Logical
OnError GoTo ErrorOccured
APICopyFile = CopyFile(sIn, sOut, n)
Exit Function
'-------------------------
ErrorOccured:
Note "Error occured: " & lf & Error$()
End Function
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16894