OpenXML Export does not work: Data.OpenXMLExportExcel operation failed. Common Language Runtime detected an invalid program

Hey all,

If anyone can help me with my issue, this would be great. this issue is driving me crazy.

I want to export some things to a predefined excel, overwriting some sheets. problem is: The openXMLExportExcel is not outputting with this error:

Data.OpenXMLExportExcel operation failed. 
Common Language Runtime detected an invalid program.

The sheet is created, but no data is written.

Revit 2026.3
Dynamo 3.6.0.x

Excel process is not running before the node starts, Excel document is not read-only, Excel bitversion is matching my revit bit version and os bitversion (x64)

Hi,

It’s probably a library conflict with another add-in or Dynamo package.

Try disabling the add-ins and retesting. If it fails again, try removing the Dynamo packages.

Another workaround is to use Python with the OpenPyXL library.

2 Likes

you are right, with no add-ins and packages loaded it works

1 Like

Hi @dick.elsman_infranea Would you share the list of packages you were using so that we can reproduce this bug? Our team would like to improve this experience when such error happens

I know Archi-lab is one

Hey @Aaron_Tang ,

The problem is with an in-house built package as we are using ClosedXML which makes use of OpenXML library.
I do think it is weird that, since this is all lazy-load, this kind of conflict can occur.

If you want to have it, I am happy to share it in a DM, but not as a downloadable link in this forum.

Thanks!