Hello. I have the same issue, but with another book (8.3.1.1)
Below test, that thorws exception
public void findNP() throws Exception {
Workbook book = new Workbook(“D:\37_Tabela 4 sata - nova_333.xlsx”);
Worksheet sheet = book.getWorksheets().get(0);
Cells cells = sheet.getCells();
PasteOptions options = new PasteOptions();
options.setPasteType(PasteType.ALL);
// First block, ok
cells.insertRange(CellArea.createCellArea(28, 1, 33, 12), ShiftType.DOWN);
book.save(“D://1.xlsx”);
Range source = createRange(cells, 25, 1, 27, 12);
Range range = createRange(cells, 28, 1, 33, 12);
range.copy(source, options);
book.save(“D://2.xlsx”);
find(cells, 25, 1, 27, 12);
find(cells, 28, 1, 30, 12);
find(cells, 31, 1, 33, 12);
cells.insertRange(CellArea.createCellArea(41, 1, 46, 12), ShiftType.DOWN);
book.save(“D://3.xlsx”);
source = createRange(cells, 38, 1, 40, 12);
range = createRange(cells, 41, 1, 46, 12);
range.copy(source, options);
book.save(“D://4.xlsx”);
find(cells, 38, 1, 40, 12);
find(cells, 41, 1, 43, 12);
find(cells, 44, 1, 46, 12);
book.save(“d:\bug.xlsx”);
}
private Range createRange(Cells cells, int row, int col, int row1, int col1) {
return cells.createRange(row, col, row1 - row + 1, col1 - col + 1);
}
private void find(Cells cells, int row, int col, int row1, int col1) {
FindOptions opt = new FindOptions();
opt.setRange(CellArea.createCellArea(row, col, row1, col1));
opt.setLookAtType(LookAtType.CONTAINS);
opt.setCaseSensitive(false);
opt.setSearchNext(true);
opt.setLookInType(LookInType.FORMULAS);
cells.find(“USBANDCOUNT”, null, opt);
}