1

I'm in an Excel web Add-in (office-js), in a .xlsx file

In Range C3: C6 there are formulas that in the same type VLOOKUP

Snapshot of before code execution

And In index.js my code is

let data=[
  ["=INDEX(R2C11:R9C11,MATCH(R[0]C2,R2C10:R9C10,0))"],
  ["=INDEX(R2C11:R9C11,MATCH(R[0]C2,R2C10:R9C10,0))"],
  ["=INDEX(R2C11:R9C11,MATCH(R[0]C2,R2C10:R9C10,0))"],
  ["=INDEX(R2C11:R9C11,MATCH(R[0]C2,R2C10:R9C10,0))"],
]
range.formulasR1C1 = data;      // Here range is C3: C6
range.select();
return ctx.sync();

Before the code above runs, the range C3: C6 is selected, it looks like the first picture.

So I expect after the code execution, the formula in the Formula Bar to update itself automatically.

What I've hoped for - an updated formula bar

But that doesn't happen and it fails to update the Formula bar.

What I'm seeing

Only if I select another cell or range, and then, re-select the Range C3: C6, the formulas in Formula Bar shows the Right Formula.

Can Anyone tell me what should I do? thx!

Community
  • 1
  • 1
国贵棠
  • 31
  • 3
  • It looks like you're assigning formulas before selecting the range - perhaps that's it? – Mavi Domates Mar 22 '19 at 08:13
  • 1
    @MaviDomates Thank u for replying. I have tried the order that Firstly, select the range, and Secondly assign the formulas, but No luck, still Doesn't update the Formula Bar Automatically. – 国贵棠 Mar 22 '19 at 13:10
  • Actually here's an interesting thought. After the assignment, if you read the contents of the cells again (in the code) do you see what you've updated / or what's there before the update. I'm trying to understand if it's writing but not updating the UI – Mavi Domates Mar 22 '19 at 13:15
  • Oh - the last bit I've re-read. So it is updating the formulas assigned to those cells, just not the formula bar! Interesting. So there's probably a bug in terms of updating the display. Can you try (programmatically) selecting another group of cells and then re-selecting the same cells which you changed the formula? Does that refresh? – Mavi Domates Mar 22 '19 at 13:22
  • Yes. After assigning the formulas, If I select another group of cells (or range) and then re-select the same cells. The Formula Bar shows the right formulas as we expect. I also think this is a bug. – 国贵棠 Mar 23 '19 at 12:52

0 Answers0