Is workbook open in current Excel instance

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

Address

Brookfield,
55 Heath Drive
Brookwood, Surrey
GU24 0HQ England

Scroll to Top