I tried using Excel.ReadFromFile node but it failed. I’ve read some topics on this forum but haven’t found any solutions.
I’m running Revit 2018.1, Dynamo 1.3.1.1736, windows 7 x64, Office 2010.
I’ve tried xls, xlsx files at many locations, all granted Editing permission to Every One (I guess I don’t need this because I’m only reading the file’s content) but all failed.
I’m coming to Dynamo as a python developer. I also read Dynamo source code on github that I assume to be the Node’s code. I also looked up in MSDN but couldn’t find any ReadExcelFile method of the WorkBook object. Is there something missing here?
Please help and correct me if I’m wrong.
Thanks!
@htlcnn, sometimes something goes wrong with Excel. Have a look at the known issues here:
Excel nodes can be rendered non-functional by bad registry data. To correct this: Go to Start–> Run → regedit. Browse to HKEY_CLASSES_ROOT–>TypeLib–>{00020813-0000-0000-C000-000000000046}. Delete the 1.8 key.
We recommend using Excel 2013 or higher. Excel 2010 works in most cases, but 2007 does not.
Thanks @zhukoven, I deleted the 1.8 key in registry and restarted my PC. The node is working now.
Btw, I’ve taken some more time to read the source code of Dynamo and realized they overload the Excel class to have the ReadExcelFile method.
Overloading is well over my head, but please post that to the github if you feel it would improve things by doing it differently. The dev team is much more active there.
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?
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
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!
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
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.
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.
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.
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”.