How would you say my code is not working the same way you were looking for ?
BTW, you could use as a function as well.
and call likeCode:Function IsWorkbookOpened(ByVal WorkbookName As String) As Boolean Dim wbkOpened As Workbook On Error Resume Next Set wbkOpened = Workbooks(CStr(WorkbookName)) On Error GoTo 0 IsWorkbookOpened = Not wbkOpened Is Nothing End Function
Code:MsgBox IsWorkbookOpened("MyWorkbook.xlsx")




Reply With Quote
Bookmarks