Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mata xl() set_named_range method

    Hello

    I'm struggling to specify Excel named cell ranges with the xl() class.
    The set_named_range() method doesn't produce the result expected
    B.set_named_range(real vector row, real vector col, string scalar name)


    Reproducible example to create a range named 'rawdata' referring to $B$1:$D$6
    mata:
    b = xl()
    b.create_book("repex", "datasheet", "xlsx")
    rows = (1,6)
    cols = (2,4)
    b.set_named_range(rows,cols,"rawdata")
    b.close_book()
    end

    //in excel, CTRL-F3 will show the name manager with range =datasheet!$A$1:$F$6
    exit
    erase "repex.xlsx"


    Many thanks
    Jane
    Last edited by Jane Schmidt; 19 Feb 2025, 06:33.

  • #2
    Jane,

    Thanks for reporting the bug with set_named_range(). It'll be fixed in the next Stata 18 update.

    Kevin

    Comment


    • #3
      Thank you for the prompt reply!
      J

      Comment

      Working...
      X