May 9, 2024

Error "This won't work because it would move cells in a table on your worksheet" when populating an Excel table with Microsoft Graph

Although populating an Excel table with Microsoft Graph is great in theory, it's not without its foibles. After being asked to customise a Power Automate process that I'd already built, I started getting "This won't work because it would move cells in a table on your worksheet".

I had encountered this error before, but seemed to work around it with some trial and error, but this time, it was proving more frustrating to get to the cause of the issue. If you google around, you'll find threads like this one and this one, in which others have tried various fixes, but they didn't help in fixing my issue.

However, after lots of tinkering, I worked out what was causing my issue: Initially, I had multiple identical tables down the page and this worked fine; however, I was asked to add additional columns to one of the tables, and if you have table 2 below table 1 and table 2 has more columns than table 1, you'll get the error every time you try pushing even a single row into table 1. If table 2 has the same number or fewer, then it's fine.

Excel Tables

So you can either ensure that your tables with the most columns is presented first, with subsequent tables underneath it. Or, you could just add the extra columns to all of the tables and populate with null values if required. Ideally, each table would be on its own sheet, avoiding the problem altogether, but the request was to have them all together.

Hopefully the above proves useful to someone, or at the very least is a reference for myself for when I next come across this issue.

Freezepop.co.uk

Informational site covering the Microsoft Power Platform, including Power Apps, Power Automate and Power BI.