}
final Book targetBook = BookHelper.getBook(_book, refBookname);
if (targetBook == null) {
throw new UiException("cannot find the named book, have you add it in the Books:"+ refBookname);
}
final RefBook targetRefBook = BookHelper.getOrCreateRefBook(targetBook);
final int s1 = targetBook.getSheetIndex(refSheetname);
final int s2 = targetBook.getSheetIndex(refLastSheetName);
final int sheetIndex1 = Math.min(s1, s2);
final int sheetIndex2 = Math.max(s1, s2);
for(int j = sheetIndex1; j <= sheetIndex2; ++j) {
final String sheetname = targetBook.getSheetName(j);
final RefSheet targetRefSheet = targetRefBook.getOrCreateRefSheet(sheetname);
DependencyTrackerHelper.addDependency(srcRef, targetRefSheet, tRow, lCol, bRow, rCol);
}
}