In the event more than 3 rows contain formuls the following exception occurs: There was 1 error: 1) testAddIntegers(org.apache.poi.hssf.usermodel.TestFormulas) java.lang.ArrayIndexOutOfBoundsException at org.apache.poi.util.LittleEndian.putNumber(LittleEndian.java:536) at org.apache.poi.util.LittleEndian.putShort(LittleEndian.java:243) at org.apache.poi.hssf.record.SelectionRecord.serialize(SelectionRecord.java:262) at org.apache.poi.hssf.model.Sheet.serialize(Sheet.java:584) at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:522) at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:474) at org.apache.poi.hssf.usermodel.TestFormulas.testAddIntegers(TestFormulas.java:130) at org.apache.poi.hssf.usermodel.TestFormulas.main(TestFormulas.java:157) oddly if I increase from 4 to 10 I get this instead: There was 1 error: 1) testAddIntegers(org.apache.poi.hssf.usermodel.TestFormulas) java.lang.ArrayIndexOutOfBoundsException at org.apache.poi.util.LittleEndian.putNumber(LittleEndian.java:536) at org.apache.poi.util.LittleEndian.putShort(LittleEndian.java:243) at org.apache.poi.hssf.record.FormulaRecord.serialize(FormulaRecord.java:353) at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.serialize(ValueRecordsAggregate.java:174) at org.apache.poi.hssf.model.Sheet.serialize(Sheet.java:584) at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:522) at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:474) at org.apache.poi.hssf.usermodel.TestFormulas.testAddIntegers(TestFormulas.java:130) at org.apache.poi.hssf.usermodel.TestFormulas.main(TestFormulas.java:157) This is weird!
*** This bug has been marked as a duplicate of 8592 ***