Excel.ReadFromFile operation failed

I’m not a .NET developer and I’m also new to Dynamo, so I would choose to stick with python and make use of working nodes :slight_smile: .

1 Like

Hi! I am also having this problem after Windows did some updates on my computer (WritetoExcel and ReadtoExcel had worked beforehand). I followed the above instructions to access the registry - mine shows a 1.7 key and a 1.9 key. Does anyone know which would be the one to delete since my registry does not show a 1.8 key?

registry

I’ve had issues with the excel node as well. I have started to use a python code script which is more stable to read my Excel files.

import clr

clr.AddReference('Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c')
from Microsoft.Office.Interop import Excel
from System.Runtime.InteropServices import Marshal

path = IN[0]

# Instantiate the Excel Application
ex = Excel.ApplicationClass()
# Make it Visiable for us all to see
ex.Visible = False
# Disable Alerts - Errors Ignore them, they're probably not important
ex.DisplayAlerts = False
# Workbook 
workbook = ex.Workbooks.Open(path)
# WorkSheet
ws = workbook.Worksheets[1]
# Cell range
x1range = ws.Range["A1", "A4"]
x2range = ws.Range["B1", "B4"]

r1 = x1range.Value2
r2 = x2range.Value2

OUT = r1, r2

ex.ActiveWorkbook.Close(False)
Marshal.ReleaseComObject(ws)
Marshal.ReleaseComObject(workbook)
Marshal.ReleaseComObject(ex)

Thanks @Danny_Bentley - this python code isn’t solving my problem either… it seems to be about the same code as the “Write Excel” node in Archi-Lab Bumblebee, which is not working for me either. I do notice that both your code and the Bumblebee code share the line

clr.AddReference('Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, 
 PublicKeyToken=71e9bce111e9429c').

The registry on my computer shows two keys, 1.7 and 1.9.

1.7 displays:
Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

1.9 displays:
Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C

Modifying the line of your code I referenced above to reflect either of the values for Version did not resolve the issue.

I am also noticing that the 1.7 key has a String Value that the 1.9 key does not; it is called “PrimaryInteropAssemblyCodeBase” with a value of
file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Office.Interop.Excel/14.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Excel.dll

I’m assuming this .dll is the reference your code is importing… In any case, it seems I need to delete one or both of the registries…? So frustrating that this issue just began after accepting an automatic Windows update!

Hi @awilliams

Could you let us know the below versions your currently using.

  • Windows
  • Revit
  • Dynamo
  • Excel

Hi @Kulkul - sorry, I should have thought to include before. I’m currently using the following:

Windows 10 Pro
Revit 2016
Dynamo 1.3.1.1736
Excel 2016

@awilliams Install this application https://www.auslogics.com/en/software/registry-cleaner/

It will automatically remove duplicate keys and keep the ones needed. Its a free tool.

Thanks @Kulkul - I used the tool and restarted my computer, reopened Revit & Dynamo, and the Excel nodes still fail… I suppose I’ll have to resort to reading/writing with CSV from now on :persevere:

What’s in the registry now relative to excel? You may want to reinstall dynamo, and attempt to read and write excel nodes without any custom nodes installed as another “troubleshoot the system” effort.

@JacobSmall this is what is in the registry now:

I tried troubleshooting by reinstalling Dynamo without custom nodes/packages and the Excel nodes still aren’t working. Could you or someone share what their registry has in it so I can compare?

My IT department has me locked out of that, but I can ask around. Consider posting the issue to the Github page to get some more direct developer attention.

1 Like

@awilliams,

i only have the 1.9 key as well and i dont have those issues.

What you could try is backup your register and delete the 1.9 key?
If you can delete the 1.8 key then it shouldnt be a problem for the 1.9 key either, but always make a back up.

1 Like

@awilliams Why not just uninstall excel and re-install it.

2 Likes

Finally solved the Excel nodes working by uninstalling & reinstalling Microsoft Office 365 Business. Thanks to @Kulkul!

1 Like

I have the same issue and after I did the excel uninstall/re-install proces Excel.ReadFromFile node still doesn’t work. I already checked my register and I only have the 1.9 key. (I already did dynamo uninstall/re-install process). I read it could be due to excel file path so I copied a test file on my desktop from the office server but I still get the message “Excel.ReadFromFile operation failed”.

Any other suggestion?

@Mattia_Berto did you try similar node from BumbleBee package?

Yeah that node works but I simply wanted to fix the builtin node issue. Currently I’m using the read from csv node. Thanks anyway

http://kb.palisade.com/index.php?pg=kb.page&id=528

Close Excel and Project.

Click Start » Run, type REGEDIT and click OK.

{00020813-0000-0000-C000-000000000046} Key for Excel

Click on Computer at the top of the left-hand panel, then press Ctrl+F to bring up the search window. Paste this string, including the curly braces {…}, into the search window:
{00020813-0000-0000-C000-000000000046}
Check (tick) the Keys box and Match whole string only; clear Values and Data.

Click the + sign at the left of {00020813-0000-0000-C000-000000000046} to expand it. You will see one or more subkeys:

1.5 for Excel 2003.
1.6 for Excel 2007.
1.7 for Excel 2010.
1.8 for Excel 2013.
1.9 for Excel 2016.
Identify the one(s) that do not match the version(s) of Excel you actually have installed. If all of them do match installed Excel versions, omit steps 5 and 6.

You are about to delete the key(s) that correspond to versions of Microsoft Excel that you do not have. For safety’s sake, you may want to back them up first. Right-click on {00020813-0000-0000-C000-000000000046}, select Export, and save the file where you’ll be able to find it.

Right-click the 1.something key that does not belong, select Delete, and confirm the deletion. Repeat for each 1.something key that does not belong.

The {00020813-0000-0000-C000-000000000046} key can occur in more places. Usually they all have the same subkeys, but not always, so you need to examine each instance. Tap the F3 key to get to each of the others in turn. For each one, repeat steps 4 through 6 (click the + sign, export the key to a new file, and delete the orphaned 1.something entries).

{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52} Key for Office

Click on Computer at the top of the left-hand panel, then press Ctrl+F to bring up the search window. Paste this string, including the curly braces {…}, into the search window:
{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
Check (tick) the Keys box and Match whole string only; clear Values and Data.

Click the + sign to expand the key. You will see one or more subkeys:

2.3 for Office 2003.
2.4 for Office 2007.
2.5 for Office 2010.
2.6 and 2.7 for Office 2013. (2.6 and 2.7 are okay for Office 2016 as well, if there is a reference to Office16 under 2.7.)
2.8 for Office 2016.
Identify the one(s) that do not match the version(s) of Office you actually have installed. If all of them do match installed Office versions, omit steps 10 and 11.

You are about to delete the key(s) that correspond to versions of Microsoft Office that you do not have. For safety’s sake, you may want to back them up first. Right-click on {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}, select Export, and save the file where you’ll be able to find it. (Choose a different name for this file, such as Key2.)

Right-click the 2.something key that does not belong, select Delete, and confirm the deletion. Repeat for each 2.something key that does not belong.

The {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52} key can occur in more places. Usually they all have the same subkeys, but not always, so you need to examine each instance. Tap the F3 key to get to each of the others in turn. For each one, repeat steps 9 through 11 (click the + sign, export the key to a new file, and delete the orphaned 2.something entries).

Close the Registry Editor.

If you run @RISK with Microsoft Project, p

1 Like

As many others, I have also repaired, reinstalled and edit options for Excel and Office over and over - and finally, this worked.
I however did not have the priviliges to delete the 1.8 folder, so make sure to run regedit as administrator, if you have the same problem.

2 Likes

I was facing same issue & resolved by reinstalling MS Office.