Validation always returns true for ‘getInCellDropDown()’ method. I am using the following file validation.xlsx.zip (19.6 KB)
The code I am using is as follows
Worksheet sheet = book.getWorksheets().get("Sheet1");
Cells cells = sheet.getCells();
Cell a2 = cells.get("A2");
Validation va2 = a2.getValidation();
if(va2.getInCellDropDown()) {
System.out.println("A2 is a dropdown");
} else {
System.out.println("A2 is NOT a dropdown");
}
Cell b2 = cells.get("B2");
Validation vb2 = b2.getValidation();
if(vb2.getInCellDropDown()) {
System.out.println("B2 is a dropdown");
} else {
System.out.println("B2 is NOT a dropdown");
}
Cell c2 = cells.get("C2");
Validation vc2 = c2.getValidation();
if(vc2.getInCellDropDown()) {
System.out.println("C2 is a dropdown");
} else {
System.out.println("C2 is NOT a dropdown");
}
The output is
A2 is a dropdown
B2 is a dropdown
C2 is a dropdown
But, the expected output is
A2 is a dropdown
B2 is NOT a dropdown
C2 is NOT a dropdown.
Please help.