bonjour
une autre méthode
function FileLocked(strFilename As String) As Boolean
On Error Resume next
' if the file is already opened by another process,
' and the specified type of access is not allowed,
' the Open operation fails and an error occurs.
Open strFilename for Binary Access Read Lock Read As #1
Close #1
' if an error occurs, the document is currently open.
if Err.Number <> 0 then
' Display the error number and description.
msgbox "Error #" & Str(Err.Number) & " - " & Err.Description
FileLocked = true
Err.Clear
end if
end function
tu trouveras des exemples dans les anciens messages
et notamment là
http://xlbysteph.free.fr/ (tests d'existence)