GetValidationValue incorrect using NotBetween operator

GetValidationValue using the NotBetween operator returns false for valid validations.

Can you please take a look?

List of Allow and Notbetween operator that give incorrect values

Cell: C2
Allow: Whole number
Data: not between
Minimum: 1
Maximum 10
Value: 11
Actual: false
Expected: true

Cell: C3
Allow: Decimal
Data: not between
Minimum: -1000
Maximum 1000
Value: 1001
Actual: false
Expected: true

Cell: C4
Allow: Date
Data: not between
Minimum: 1-1-2020
Maximum 31-12-2020
Value: 15-3-1993
Actual: false
Expected: true

Cell: C5
Allow: Time
Data: not between
Minimum: 9:00:00
Maximum 17:00:00
Value: 18:30:00
Actual: false
Expected: true

Cell: C6
Allow: Text length
Data: not between
Minimum: 0
Maximum: 6
Value: abcdefg
Actual: false
Expected: true

Example code

var workbook = new Workbook(@"Data validation Not between.xlsx");
Worksheet sheet1 = workbook.Worksheets[0];

Cell cellC2 = sheet1.Cells["C2"]; bool isValidC2 = cellC2.GetValidationValue();
// expected: true, actual: false

Cell cellC3 = sheet1.Cells["C3"]; bool isValidC3 = cellC3.GetValidationValue();
// expected: true, actual: false

Cell cellC4 = sheet1.Cells["C4"]; bool isValidC4 = cellC4.GetValidationValue();
// expected: true, actual: false

Cell cellC5 = sheet1.Cells["C5"]; bool isValidC5 = cellC5.GetValidationValue();
// expected: true, actual: false

Cell cellC6 = sheet1.Cells["C6"]; bool isValidC6 = cellC6.GetValidationValue();
// expected: true, actual: false

Excel sheet

Data validation Not between.zip (8.5 KB)

@perfectxl,

Thanks for the template Excel file.

Please notice, I am able to reproduce the issue as you mentioned by using your template file and sample code. I found GetValidationValue is incorrect using NotBetween operator. I have logged a ticket with an id “CELLSNET-52018” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@perfectxl,

This is to inform you that your issue has been resolved now. The fix will be included in the next upcoming release (Aspose.Cells for .NET v22.10) which is scheduled in the first/second week of October 2022. You will also be notified when the next version is released.

The issues you have found earlier (filed as CELLSNET-52018) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi