Function IsWorkbookOpen() As Boolean
Dim xlApp As Object
Dim xlBook As Object
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
On Error GoTo 0
If Not xlApp Is Nothing Then
For Each xlBook In xlApp.Workbooks
If xlBook.Name = "Книга1" Then
IsWorkbookOpen = True
Exit For
End If
Next xlBook
xlApp.Quit
Else
IsWorkbookOpen = False
End If
Set xlBook = Nothing
Set xlApp = Nothing
End Function