vb Code:
  1. for wb = 1 to workbooks.count
  2.    if wb.name = "workbookA.xls" then
  3.        for each sh in wb.sheets
  4.           if sh.name = "Sheet1" then a = true: exit for
  5.        next
  6.    elseif  wb.name = "workbookB.xls" then
  7.        for each sh in wb.sheets
  8.           if sh.name = "Sheet2" then b = true: exit for
  9.        next  
  10.    end if
  11. next
  12. if a and b then
  13.   msgbox "both open"
  14. else
  15.   msgbox "both not open
  16. end if
names of workbooks and sheets need to be exact and case sensitve