bueno este code te permite verificar si un file existe
Public Function FileExists(strPath As String) As Boolean ' verifica si un archivo existe
On Error Resume Next
If Len(strPath) < 4 Then
FileExists = False
Exit Function
End If
FileExists = IIf(Dir(strPath, _
vbArchive + vbHidden + vbNormal + vbReadOnly + vbSystem) <> "", True, False)
End Function
para copiar esta función, te aconsejo que uses APIs en lugar de las funciones del VB, la filecopy es bastante vigilada por avs
Option Explicit
Private Declare Function SHFileOperation Lib "shell32.dll" _
Alias "SHFileOperationA" ( _
lpFileOp As SHFILEOPSTRUCT) As Long
Private Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Long
fAnyOperationsAborted As Boolean
hNameMappings As Long
lpszProgressTitle As String
End Type
Private Enum eFO
FO_COPY = &H2&
FOF_NOCONFIRMATION = &H10&
FOF_NOCONFIRMMKDIR = &H200&
End Enum
Public Sub mCopyFile(sSource As String, sTarget As String) ' Procedimiento para Copiar un archivo
Dim SHFileOp As SHFILEOPSTRUCT
sSource = sSource & vbNullChar & vbNullChar
sTarget = sTarget & vbNullChar & vbNullChar
With SHFileOp
.wFunc = FO_COPY
.fFlags = FOF_NOCONFIRMMKDIR + FOF_NOCONFIRMATION
.hWnd = Form1.hWnd
.pFrom = sSource 'origen
.pTo = sTarget 'Destino
End With
Call SHFileOperation(SHFileOp)
End Sub