Dim excel_file_opened As Boolean = False
Private Sub Test(ByRef sName As String)
Dim fs As FileStreamTry
fs = File.Open(sName,FileMode.Open,FileAccess.Read,FileShare.None)
excel_file_opened = False
fs.Close() Catch ex As Exception excel_file_opened = True End Try End Sub