Something wrong when using Microsoft.Office.Interop.Excel in Revit 2025, Dynamo 3.0.2

It can run well in previous version. But pop up the warning in Revit 2025, Dynamo 3.0.3.


My understanding was in Net Core and beyond Python was not able to use the interop tools for Excel, but commenting here in case there is actually a fix. I believe C# still has ways to package and access it, but OpenXML was getting more endorsement in my searches.

It’s going to hit my pyrevit toolbar like a nuke once we reach 2025, but I’ve been learning C# as an escape route from the Python gotchas etc. for a while now.

If you end up using CP3, look into pandas as an alternative route maybe.

Good guide on working with CP3/packages etc. here:

1 Like

Thank you for your quick reply. I also think it should be caused by the Net Core update, so I posted this issue in the forum and look forward to the latest solution (if keep using ironpython2). :grinning:

Based on the messaging I’ve been getting the likely response you will get is not to use ironpython2 in future. I’m already beginning to pivot to CPython3 where possible in Crumple (not released as such), the writing is on the wall come 2025. I was hoping to use IP2 for as long as possible but in my testing the net core change really prevents IP2 being continuable I think in current state.

I was planning to piggyback on pyrevit supporting IP2, but messaging there also leans towards CP3 or later variants of IP at the least. Time to bite the bullet I think.

Hi,

Interrop still works, but Net Core don’t have access to the Global Assembly Cache GAC

I recently updated an example here for Net 8 compatibility

Pandas, openpyxl and Openxml are also viable solutions

3 Likes

I’m curious RE how enums are built upon/maintained by MS - are these values effectively fixed in future updates of interop as far as you know? I’m always hesitant on assumed constants but have used this before as well for other purposes.

due to the change to Net 8, I recommend using IPY3, CP3 or C#. Be careful however with CP3 it does not yet include PythonNet 3

.Net 8 should in my opinion mean new package versions

1 Like

It’s just an workaround, another option is to use the same assembly version of Excel Interrop that Dynamo Team use in Dynamo 3

1 Like

Yes generally at this point I have decided to convert as much of Crumple as I can to CP3, as much work as it may be… your advice helps reaffirm my choice. Aware CP3 may be challenging, but having to suggest parallel IP package installs has been a challenge when trying to encourage and guide use of the package.

the problem is that CP3/Pythonnet2 has some bugs and .Net 8 adds others (hence my mention of IP3 and C#)

As indicated on the Dynamo roadmap, PythonNet3 integration is planned, which should correct many bugs.

2 Likes