Thanks for using Aspose.Cells.
Please see my above post.
To explain it further, I have written the following sample code and also shown its console output. I have also attached the
sample excel file used in this code and the
output excel file generated by it for your reference.
If you look into the code, I am changing the value of cell A1 from dropdown list and whenever its value changes, it also changes the value of cell D2. This is how we can change the dropdown list value of the cell and then calculate the new values of the affected cells.
//Create a workbook object
Workbook wb = new Workbook(“sample.xlsx”);
//Access first worksheet
Worksheet ws = wb.Worksheets;
//Access cell A1
Cell a1 = ws.Cells[“A1”];
//Get the dropdown list validation
Validation val = a1.GetValidation();
object values = val.Value1 as object;
for (int ddIndex=0; ddIndex<4; ddIndex++)
//Change the value of cell A1 and calculate the value cell D2
string ddValue = (string)values[ddIndex];
//Put dropdown list value in cell A1
//Now calculate formula
//Print the value of cell D2 on console and debug
//Save the workbook