Dynamo Data.ExportToExcel Problems

Hi All,

I’m currently trying to export some data into excel and I’m running into a couple issues.
I’ve created a couple lists for model changes, and created sub-lists to break them up.

But when I try to use the Data.ExportToExcel node, I just get a Warning saying “Warning: Data.ExportToExcel has failed”. I’ve dug around some forums and checked some videos and see other peoples Excel export node doesn’t have the “WriteAsString” input where mine does but its just a boolean that’s default to False. (Tried False / True).

I’ve seen a few people mention it can be due to windows updates and to try the XML Export instead which has a boolean ouput instead of data, but it doesn’t do anything and doesn’t open the Excel file upon running the script. Then when I try and open the Excel file manually I get an error message and that the file needs recovered.

Any Ideas?

Thanks

Have you tried putting the filepath in as a string?

Use the string from object node between the file path node and the excel node.

Also, what does the yellow warning say?

Yea I tried the string input too, had the same issue with both XML and Export.
The warning just says “Warning: Data.ExportToExcel has failed”

image

Wow, what a helpful message :joy:

Have you tried feeding in a single string as the data to see if that prints anything?

Have you checked your sheet name is correct?

Have you tried putting the same node on the canvas and rewriting it (sometimes they corrupt)

Just opened the excel file and it seems that changing the file path to a string sorted it with the Data.OpenXMLExportExcel node instead of the Data.ExportToExcel Node. But when I open the excel file after running the script it asks me to recover the file and I get this error report:

Weird, why do you think that is?

Thanks for the help!

If you open task manager do you have excel running in the background?

I’ve; found a couple of times Dynamo doesn’t seem to shut excel properly- particularly if I use the BumbleBee node (I know you’re not).

Have you tried with a new, blank excel sheet?

Yea I tried a couple different excel files, and no excel isn’t running in the background from what I can see on task manager.

It seems to have completed the task now I have the excel file with the information I need, but I’m not looking to have to check an error report every time I want to run the script. Might dig round and see if there are other ways I can do it, thanks

1 Like

Hi Andrew i know this is an old topic but with no solution yet provided. Did you ever find the cause of this corruption? I am using the open XML export node to populate an existing excel template file. However i get the same error.

The template excel file contains a pivot table. It seems that the exporter is breaking this.

Using Revit 2025 with Dynamo 3.2.

Hi @jm_cop_de :slightly_smiling_face: Thanks for reaching out and bringing this issue to our attention. We took a quick look and we found nothing that was obvious, so we’ll need more time to explore deeper and figure out why this is happening.

It would help us if we had some more information. Do you get this error when you export to an excel workbook which doesn’t have a pivot table? And is the data that is exported from dynamo used by the pivot table?

Hello Achintya,
thanks for the reply. When I remove the pivot table worksheet beforehand, the export works with no corruption. Attached is the template file I am trying to export to.
TEMPLATE_XXX_Sheet_List.xlsx (28.2 KB)

BTW previously we used the Bumblebee exporter for some time with no problems. I am switching to the ootb Open XML exporter to better future-proof our scripts and given the earlier problems with MS Office updates.

@jm_cop_de It is a good strategy to use ootb nodes for future proofing the scripts.
Thank you for sharing this with us, very helpful for us! We will look into this and get back to, so you can use the OOTB Open XML nodes.

1 Like

Achintya, I suspect the problem with the exporter has nothing to do with Pivot tables but the existence of duplicate values in any cell within the existing template file regardless of if it occurs in a different worksheet. So I have done some testing and have found within a separate script and template file that when a column header in one worksheet is the same as a column header in another then the corruption occurs. When the duplicate value is delete or changed then there is no longer a corruption. Could you test this from your end?

Yes, you are right. I was able to reproduce this when the data being exported has a string. I did not seem to get any errors when the data is just integers. Thanks for helping us narrow down the issue. We will explore this further.