Excel Vba Check If Workbook Exists. A Workbook is already open or not. This is a simple VBA function that will return true if the current workbook contains a sheet with the exact name passed through the function and returns false otherwise.
Name Does this really works then another user at another pc in the network opens in his excel-application the My idea is that VBA raises an Error then you try to open a file that is already open.
This is a simple VBA function that will return true if the current workbook contains a sheet with the exact name passed through the function and returns false otherwise.
It uses the IF condition to check if the name of the workbook is the same as that of the workbook where the code is being run. VBA error handling consists of GoTo or Resume, both of these are far from wonderful, but I've always felt I have more control over a GoTo than a Resume as a Resume could easily pass unnoticed without a conditional check on an error result. Function BookOpen(Bk As String) As Boolean Dim T As Excel.workBook Err.clear 'clears any errors On Error Resume Next Set T = Application.








