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 1 reply, has 2 voices, and was last updated by  linzhixiang2017 7 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 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

    #4419

    linzhixiang2017
    Participant
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.