range.formulas assignment is not updating the Formula Bar in Excel add-in

63 Views Asked by At

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!

0

There are 0 best solutions below