1

I want to add multiple rows at a time to table on Excel. Right now we are adding using for loop.

 await Excel.run(async (ctx: Excel.RequestContext) => {
        sheet = ctx.workbook.worksheets.getItem('sheetName');
        table = ctx.workbook.tables.getItem('tableName');
        await ctx.sync();

        for (let i: number = 0; i < addRowCount; i++) {
          table.rows.add();
        }
}

Is there API on Office js which allow to insert multiple rows at a time?. I was exploring Excel.Range class. but did not find any helpful one.

1 Answer 1

1

Yes. Beginning with Excel.js 1.4, you can use the same add method to add multiple rows. See TableRowCollection.add.

Sign up to request clarification or add additional context in comments.

1 Comment

No code example :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.