如何识别以检查是否另一个工作簿已经打开

目前我正在使用TASK MANAGER打开工作簿,有些时候以前的任务没有完成,即仍然macros已经在运行另一个工作簿,所以在这里我要检查是否有其他工作簿已经打开或运行macros; closures当前打开工作簿由任务pipe理器,我有简单的代码,如下所示,但我想尝试其他:

If thisworkbook.name <> activeworkbook.name then call sendemail ' don't need code else Call Run_Dashboard End if 

 Dim wb as Workbook On Error Resume Next '//this is VBA way of saying "try"' Set wb = Application.Workbooks(wbookName) If err.Number = 9 then '//this is VBA way of saying "catch"' 'the file is not opened...' End If 
 Function Is_Workbook_Open(byval WB_Name as String) as Boolean Dim WB as Workbook For each WB in Application.Workbooks if WB.Name = WB_Name then Workbook_Open = True Exit Function End if Next WB End Function 

解决scheme如果打开工作簿,则无error handling。