How to set a value for a List

Home Forums Open-Xml-Sdk-JavaScript How to set a value for a List

This topic contains 0 replies, has 1 voice, and was last updated by  rs 7 months, 1 week ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #3896

    rs
    Participant

    Hello

    A cell in my excel contains a List. How can I set the cell value programatically?

    eg. cell has an option for Gender -> Male, Female

    I used the following code snippet but this does not work

    //Gender
    var gender= wsXDoc.descendants(S.c).where(function(sh) {
    return sh.attribute(“r”).value === ‘C6’;
    }).firstOrDefault();
    if (gender)
    {
    var newMode = new XElement(S.c,
    mode,
    new XElement(S.v, “Female”));
    gender.replaceWith(newMode);

    }

    Thanks
    rs

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.