In version 3.13, the following code works even if(row1==row2). sheet.addMergedRegion(new CellRangeAddress(row1, row2, 0, 0)); But in 3.16, the above code doesn't work if row1==row2. and it raises the Exception java.lang.IllegalArgumentException message(" Merged region A11 must contain 2 or more cells."). So does the new version add this restriction?
When row1 == row2 == 10 and start column and stop column are both 0, then the merged region contains just one cell, A11. This is not allowed in Excel. This rule is now enforced in POI to prevent creating a corrupt workbook.
Got it, Thanks.