text: public int CheckExternSheet(int firstSheetIndex, int lastSheetIndex){int thisWbIndex = -1; for (int i = 0; i < _externalBookBlocks.Length; i++){SupBookRecord ebr = _externalBookBlocks[i].GetExternalBookRecord();if (ebr.IsInternalReferences){thisWbIndex = i;break;}}if (thisWbIndex < 0){throw new InvalidOperationException("Could not find 'internal references' EXTERNALBOOK");}int j = _externSheetRecord.GetRefIxForSheet(thisWbIndex, firstSheetIndex, lastSheetIndex);if (j >= 0){return j;}return _externSheetRecord.AddRef(thisWbIndex, firstSheetIndex, lastSheetIndex);}