excel - How to Identify to check if Another workbook is already open -
currently opening workbook using task manager, time previous task not completed i.e. still macro running of workbook, here wan check if other workbook open or running macro; close current opened workbook task manager, have simple code per below want try else:
if thisworkbook.name <> activeworkbook.name call sendemail ' don't need code else call run_dashboard end if
dim wb workbook on error resume next '//this vba way of saying "try"' set wb = application.workbooks(wbookname) if err.number = 9 '//this vba way of saying "catch"' 'the file not opened...' end if
Comments
Post a Comment