Skip to: Site menu | Main content

Login

Name: 
Password:
Remember me?
Register

WorkbookExists?

written by Mark Rowlinson - Last updated Sep 2005

The following function returns true or false depending on whether the name of the workbook passed to it is open or not in the current application.

 
Function BookExists(strname As String) As Boolean 
    On Error Resume Next 
    Dim wb As workbook 
    Set wb=workbooks(strname) 
    BookExists = Not wb Is Nothing 
End Function