Attribute VB_Name = "Module1"
Public Function File_Copy(currentFilename As String, newFilename As String)
Dim a%, Buffer%, temp$, fRead&, fSize&, b%
On Error GoTo ErrHan:
a = FreeFile
Buffer = 4048
Open currentFilename For Binary Access Read As a
b = FreeFile
Open newFilename For Binary Access Write As b
fSize = FileLen(currentFilename)
While fRead < fSize
DoEvents
If Buffer > (fSize - fRead) Then Buffer = (fSize - fRead)
temp = Space(Buffer)
Get a, , temp
Put b, , temp
fRead = fRead + Buffer
Wend
Close b
Close a
File_Copy = 1
Exit Function
ErrHan:
File_Copy = 0
End Function

