Hello everyone,
I am in the process of setting up a new computer with Revit 2026.2 and Dynamo Revit 3.5.2.1694. Office/Excel is also installed on this computer.
In my Dynamo scripts (which work fine in Revit 2023), I make extensive use of Excel connections. Unfortunately, in Revit 2026 I cannot get this to work at all.
I keep getting the following error message:
“PythonEvaluator.Evaluate operation failed. Traceback (most recent call last): File “”, line 6, in
IOError: [Errno 2] Could not load file or assembly ‘Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’. The system cannot find the file specified.”
I have already repaired Office and the Microsoft.Office.Interop.Excel.dll is present. The version and PublicKeyToken also match.
The code in my Python (IronPython2) script is as follows:
import clr
clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c')
from Microsoft.Office.Interop import Excel
Do you have any idea what the problem could be?
Could it be that the dll is somehow not registered correctly?
(I’m running a 64 bit windows 11 and the latest office 365)
Strange thing is that DSOffice.Excel.ReadExcelFile(myfilepath) seems to work.
But that means I have to rewrite my Dynamoscript which fills the Excel sheet.
The DSOffice commands are very different.
With Revit’s switch to .NET 8 there is no longer access to the global assembly cache. As a result clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c') is going to fail.
Lots of good discussions on this on the forum already - @c.poupin has some exceptional posts as well. This post in particular has some good stuff in it: Something wrong when using Microsoft.Office.Interop.Excel in Revit 2025, Dynamo 3.0.2 - #5 by c.poupin
All of this means you will have to update your interop method for the new environment. Sadly Microsoft hasn’t made it easy on developers.
If you do use a Dynamo provided method, I recommend utilizing the OpenXML version as the other one will be deprecated in a coming release.
1 Like
Thanks for your reply Jacob!
I´m trying to rewrite my script using DSOffice. I´v read that this is a better and more stable way to communicate with Excel. The only problem I have is finding the ricght commands and syntax.
Do you have any idea where I can find more info on DSOffice.Excel commands?
It isn’t, and you will have to do this all over again in a year or so when that is removed from Dynamo entirely. Can you indicate where you read it so I can help correct the information for others?
What you can do with that namespace is likely well documented though. Use Python’s dir function to expose what you can do with it. If you imported it as the alias dsoffice then OUT = dir(dsoffice) will work. You’ll get every method annd property available. After that you can pull the information about what a method needs for inputs using OUT = dsoffice.methodname.__doc__.
1 Like
I’ve asked ChatGPT what the preferred way to communicate with Excel in Revit is. Is it DSOffice or Microsoft.Interop.Excel. 
So you say I have stay with the Microsoft.Interop solution. I’ve read the post you mentioned but it’s not clear to me what to change in my script.
Maybe you have an example of script which opens a Excel file and changes a cell value?
I don’t have one handy, but if that is all you are after… Why use Python? The OpenXML node will do that just fine.
I’ve removed “clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=15.0.0.0, Cu…..
And added:
ex = System.Activator.CreateInstance(System.Type.GetTypeFromProgID(“Excel.Application”, True))
and this seems to work, no need to rewrite my python script (for now).
Glad this is working, but know that might create some other issues as this is creating a new excel instance, meaning repetitive runs may cause issues if you don’t deal with that later in the script.
1 Like
In my experience ms interop doesnt work long term. Windows updates intefere with it and to my understand microsoft is dropping support for it.
I used closedxml these days in c#, and pandas in python which dynamo can access once it is installed on the machine.