how to check through Access whether some Excel file is opened

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I would appreciate if any body could advise how to check
through Access whether some Excel file is opened.

Thanks advance
 
Hi Alex,

I use the function below, I wish I remembered where I found it so I could
give proper credit....




Function FileLocked(strFileName As String) As Boolean
On Error Resume Next

Open strFileName For Binary Access Read Lock Read As #1
Close #1

If Err.Number <> 0 Then
FileLocked = True
Err.Clear
End If

End Function






HTH,
Immanuel Sibero
 
Thank you very much
-----Original Message-----

Hi Alex,

I use the function below, I wish I remembered where I found it so I could
give proper credit....




Function FileLocked(strFileName As String) As Boolean
On Error Resume Next

Open strFileName For Binary Access Read Lock Read As #1
Close #1

If Err.Number <> 0 Then
FileLocked = True
Err.Clear
End If

End Function






HTH,
Immanuel Sibero





.
 
Back
Top