avalanche1
avalanche1

Reputation: 3592

Excel JavaScript API - How to change calculation mode

This is my code:

Excel.Application.set({calculationMode: "Manual"});

But the compiler throws

TS2339: Property 'set' does not exist on type 'typeof Application'.

What is the api to change calculation mode?

Upvotes: 0

Views: 411

Answers (1)

David Chesnut
David Chesnut

Reputation: 66

I think you just need to set the calculation mode in a context like in the following code.

async function setCalculationMode() {
  await Excel.run(async (context) => {
    context.application.calculationMode = Excel.CalculationMode.manual;
    await context.sync();
  });
}

Upvotes: 1

Related Questions