List validation wrongly allows any input

As in attached worksheet, the column ( like G) is specified as list validation, but I still can enter any text and save to that column. Below is the code I used, please let me know if it's caused by my logic, or it's a known issue (I'm using 4.7.1.1)


Range range = worksheet.Cells.CreateRange(strColumnIndex+"1", strColumnIndex+"10");
range.Name = "listValidation" + strColumnIndex;
Validation validation = validations[validations.Add()];
validation.Type = Aspose.Cells.ValidationType.List;
validation.Operator = OperatorType.None;
validation.InCellDropDown = true;
validation.Formula1 = "=" + "listValidation" + strColumnIndex;
validation.ShowError = true;
validation.AlertStyle = ValidationAlertType.Stop;
validation.ErrorTitle = "Error";
validation.ErrorMessage = "Please select a color from the list";
CellArea area;
area.StartRow = 11;
area.EndRow = 5011; //STODO: decide the upper limit of exported user.
area.StartColumn = x;
area.EndColumn = x;
validation.AreaList.Add(area);



Thanks so much

Hi,


Well, since you are using some older version of the product, so we are not sure about it if this was an issue with that version (v4.7.1.1) or not. We recommend you to kindly upgrade to and try our latest version/fix: Aspose.Cells for .NET v7.6.0.5 and it should work fine as expected. Also, I suspect your lines of code might not even processed for your output Excel file you attached because it won’t take care of these lines and the respective List Data Validation options are not implemented either.

validation.Formula1 = “=” + “listValidation” + strColumnIndex;
validation.ShowError = true;
validation.AlertStyle = ValidationAlertType.Stop;
validation.ErrorTitle = “Error”;
validation.ErrorMessage = “Please select a color from the list”;


If you still find the issue with our latest version/fix v7.6.0.x, kindly do create a sample console application, zip it and provide us here to reproduce the issue on our end, we will check your issue soon.

And, please see the document / article on how to apply List Data Validation:



Thank you.