Excel.WriteToFile Track Changes made in Excel

Hi All,

New to Dynamo… FYI. I’ve attached a screenshot of my functioning code, but the problem is when I add a new row into Excel, the Code Block referencing the Excel grid does not track the change and automatically update.

My excel file is a live document that will be changing constantly and, if possible, this functionality would save me hours of time. So the question is, can Dynamo track the changes caused by additions of rows & columns and automatically update the Code Block in the attached string?

Thank you!

In Automatic Run mode, it does.

Hey Vikram,

Thanks for taking a look at this. I’m actually trying to go the other way from Excel to Dynamo. When I add a new row into the excel file, I have to manually go back into the Code Block and update the Row number. See attached.

Is there a solution for this?

You could try to structure your data better. For example, have a second excel sheet that lists all wall types and their area, then do a lookup/search in that sheet from your main sheet. That way excel will be able to automatically adjust things every time you add a row/column.

Or you could add a COUNTA formula in excel and always query the result in Dynamo as a replacement to your code block. That way, new rows are always counted and you’ll in effect create a simple synchronisation mechanism between the two applications


Thanks for the response - it’s much appreciated.

Doesn’t this still pose the same problem? When I add a new row into the “second” excel sheet, say right in between two different wall types, how does Dynamo track the change in the Row Number for the data that was forced to move down one cell by the addition of a new row?


Thanks for the reply.

Could you maybe do a quick string of code to show how your solution would work? I’m not quite sure how to query the result of a COUNTA formula.

Thank you!

Not a solution, a suggestion…
For Dynamo to detect changes in Excel you’ll need to restructure your graph to include Excel.ReadFromFile in your workflow.

Here is the solution using “MATCH” function in excel which specify item in a range of cell, and then returns the relative position of that item by column and row.


That’s it Kulkul!!! Thank you!!!

Ideally the second sheet would only be edited through Dynamo. Its content would be added to a named range, and you’d use that named range in your formulas. Check out the example spreadsheet below:

example.xlsx (9.3 KB)