JKPieterse
Aug 06, 2024Silver Contributor
Status:
New
Allow passing a single value to the Range object Values and Formulas
When setting Values or Formulas (and the sisters of the Formulas property), according to the docs we're supposed to pass an array of Any[][]: https://learn.microsoft.com/en-us/javascript/api/excel/e...
JKPieterse
Aug 12, 2024Silver Contributor
FYI: The code in my example runs successfully when ts-ignore is added:
async function run() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getActiveWorksheet();
const rng = sheet.getRange("A1:A10");
//@ts-ignore
rng.formulas = "=B1";
await context.sync();
});
}