We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Validation.addCellArea error

I'm using cells for java

I'm creating n Validation instances:

Validations validations = sheet.getValidations();
int v1 = validations.add();
int v2 = validations.add();
after this sheet.getValidations().size() returns "n",
then I initialize all validations and thn
I add a CellArea to Validation v1

Validation validation = validations.get(v1);
CellArea cellArea = new CellArea(1, 1, 2,2);

and after calling addCellArea() sheet.getValidations().size() returns "1" (one)!! All other validations are removed from "Validations"?!

What I'm doing wrong?


Please set
Validations one by one. When changing the affected range of one Validation,
other validations will be checked too to make sure there is no overlapped range
on which it has more than one validation. If the newly set range of one validation
overlaps ranges of other validations, then, the overlapped part will be removed
from those validations. And if those validations’ area becomes empty, they will
be removed from the collection because validations without affected range are
invalid. We think it is same with the behavior of MS Excel, in which you cannot
create more than one validation on the same range or keep a validation without
affected range.
Thanks for your understanding!

Thanks for your help!

I rearranged my code so that each Validation becomes immediately it's CellRange - and now it work fine.