Search code examples
.netaspose-cells

How to put choice value using aspose.cell?


I am using Aspose. Cell for .net to write some data into Excel. I have a quick question:

how to insert such kind of value?

enter image description here

I find that there is a method "cell.putvalue(string)" , is it possible?

thanks


Solution

    1. If it is List data validation applied in the worksheet cell, then you may simply try to use: Cell.PutValue(stringvalue) to insert the value into the cell.

    2. If it is ComboBox ActiveX control, you may try like following:

    //Access first shape in the sheet as combo box control, and set its value property
    Aspose.Cells.Drawing.ActiveXControls.ComboBoxActiveXControl combo = ws.Shapes[0].ActiveXControl as Aspose.Cells.Drawing.ActiveXControls.ComboBoxActiveXControl;
    combo.Value = "Y";
    

    PS. I am working as Support developer/ Evangelist at Aspose.