Function to check if workbook is open in the current
Excel instance.
Returns a boolean value.
Author: michael@excelexperts.co.uk
Function IsWorkbookOpen(WBname) As Boolean
Dim x As Workbook
On Error Resume Next
Set x = Workbooks(WBname)
If Err = 0 Then
IsWorkbookOpen = True
Else
IsWorkbookOpen = False
End If
End Function