Share via

Excel worksheet/table protection (programmatically adding rows using MS Graph API)

Jason Whitwill 20 Reputation points
2025-03-18T18:17:54.0033333+00:00

We have an integration with MS Excel where we are programmatically adding rows to a table within a worksheet. Currently we are not doing so in batches - so we're adding one row at a time.

The concern is that our users may end up doing things like moving columns around, adding/removing columns etc. and that resulting in the workflow being broken. The first approach we tried in order to mitigate this was to call unprotect, add the row, then call protect for each row being added to the table. These calls are taking 2-4 seconds each for us and sometimes timing out.

Is anyone aware of another approach that might allow us to continue populating the rows in the table programmatically without having to unlock? I'm not so much concerned about the data within the table being changed as much as the dimensions (the columns) of the table itself - so if we could just lock the headings (if that were an option) it might work better.

Aside from batching, is there any optimizations you might recommend for making this workflow more efficient?

Microsoft Security | Microsoft Graph

1 answer

Sort by: Most helpful
  1. Aashutosh Tiwari - MSFT 435 Reputation points Microsoft External Staff
    2025-04-10T09:35:33.1266667+00:00

    Hi Jason Withull,

    Thank you for reaching out to Microsoft!

    To achieve the objective, you can use Graph API connectors. You can utilize standard REST APIs for create, read, update, and delete operations on Excel objects.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.