java: public void removeSheet(int sheetIndex) {if (boundsheets.size() > sheetIndex) {records.remove(records.getBspos() - (boundsheets.size() - 1) + sheetIndex);boundsheets.remove(sheetIndex);fixTabIdRecord();}int sheetNum1Based = sheetIndex + 1;for(int i=0; i<getNumNames(); i++) {NameRecord nr = getNameRecord(i);if(nr.getSheetNumber() == sheetNum1Based) {nr.setSheetNumber(0);} else if(nr.getSheetNumber() > sheetNum1Based) {nr.setSheetNumber(nr.getSheetNumber()-1);}}if (linkTable != null) {linkTable.removeSheet(sheetIndex);}}
C#: public void RemoveSheet(int sheetIndex){if (boundsheets.Count > sheetIndex){records.Remove(records.Bspos - (boundsheets.Count - 1) + sheetIndex);boundsheets.RemoveAt(sheetIndex);FixTabIdRecord();}int sheetNum1Based = sheetIndex + 1;for (int i = 0; i < NumNames; i++){NameRecord nr = GetNameRecord(i);if (nr.SheetNumber == sheetNum1Based){nr.SheetNumber = (0);}else if (nr.SheetNumber > sheetNum1Based){nr.SheetNumber = (nr.SheetNumber - 1);}}if (linkTable != null){for (int i = sheetIndex + 1; i < NumSheets + 1; i++){linkTable.RemoveSheet(i);}}}