Saludos, mira debido a que en VB6 no funciona Try, nos vemos forzados a usar Goto, pero solamente para manejo de errores.
Aqui te muestro una función para saber si el archivo esta siendo usado o no:
Código vb:
Ver originalFunction IsFileOpen(strFileSpec As String) As Boolean
' Purpose Test to see if the file has been locked by another process
Dim intFn As Integer, lngErrNum As Long, strErrDescr As String
On Error Resume Next ' No Error checking
intFn = FreeFile() ' Get a free file number.
' Attempt to open the file and lock it.
Open strFileSpec For Input Lock Read As intFn
Close intFn ' Close the file.
lngErrNum = Err.Number ' Save the error number that occurred.
strErrDescr = Err.Description
On Error GoTo 0 ' Turn error checking back on.
' Report the error
Select Case lngErrNum
Case 0
' No error occurred - File is NOT already open by another user.
IsFileOpen = False
Case 70
' Error number for "Permission Denied. - File is opened by
another user.
IsFileOpen = True
Case Else
' Yikes some other error occurred.
IsFileOpen = False
MsgBox "Error! " & vbCrLf & "Error Number " & lngErrNum & vbCrLf
& "Error Descr " & strErrDescr, vbExclamation, "IsFileOpen()"
End Select
End Function