diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java index c6f5a839d..35d09c6b6 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java @@ -1159,8 +1159,9 @@ public class HSSFCell implements Cell { break; } - int eofLoc = _sheet.getSheet().findFirstRecordLocBySid( EOFRecord.sid ); - _sheet.getSheet().getRecords().add( eofLoc, link.record ); + List records = _sheet.getSheet().getRecords(); + int eofLoc = records.size() - 1; + records.add( eofLoc, link.record ); } /** * Only valid for formula cells