I’m getting the following exception in calling insertRows. At a guess
it looks as though your insert operation is expecting a cell area to be
set up with columns, but insertRow only takes rows as an argument. So
I’d guess you have an initialization bug, or you expected me to have
done something with cells prior to this point.
This occurs with latest download - 1.7.4.
xception in thread “main” java.lang.IllegalArgumentException: Invalid column index: -1
at com.aspose.cells.aD.d(Unknown Source)
at com.aspose.cells.CellArea.(Unknown Source)
at com.aspose.cells.Cells.l(Unknown Source)
at com.aspose.cells.Cells.insertRows(Unknown Source)
My code is:
Cells cells = worksheet.getCells();
int nCurrentDataRows = 1 + rowData.getEndRow() - rowData.getStartRow();
int nRows = model.getRowCount();
if (totalsData != null)
if (nRows > nCurrentDataRows)
int totalTop = totalsData.getStartRow();
// move the totals area cells down
cells.insertRows(totalTop, nRows - nCurrentDataRows);<br>
The parameters for insertRows are 2 and 3.