# Excel import leads to Error Object reference not set to an instance

**URL:** <https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998>\
**Category:** Revit\
**Tags:** revit, excel, dynamo, error\
**Created:** [May 9, 2025, 7:49am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998 "2025-05-09T07:49:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 7:49am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/1 "2025-05-09T07:49:33Z")

</div>

Hey everyone,

an originally working Dynamo script for Revit, which reads two Excel lists, suddenly shows an error when reading the same Excel list but in a shortened version:

**“List.Contains failed. Object reference not set to an instance of an object.”**

I just copied the original excel list and shortened it, so there is less information in it… didn’t change the header or anything else ☹

 ![Dynamo script (top right corner: node with error)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/e/dee030fd9f83b60ac33f01f8b93123c6bec5e13d.png)

Uploading: Excel\_Test\_V3\_Andreas.xlsx…  
[Excel\_Test\_V4\_Andreas.xlsx](https://forum.dynamobim.com/uploads/short-url/wpMaBB0FpZtHz7RDq1yEsZroZf7.xlsx) (14.3 KB)

What could be the cause of this?

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 7:56am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/2 "2025-05-09T07:56:56Z")

</div>

probably there have been an office upgrade and then break it…you could try “online repair tool” but it will probably come again next time its upgrade…try use Data.OpenXMLImportExcel node and see if it could help, but not 100% its the case in your example

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:01am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/3 "2025-05-09T08:01:23Z")

</div>

I don’t really get what you mean with “online repair tool”… Do you mean a online repair tool for office or for dynamo?

Tried it with the Data.OpenXMLImportExcel node - same error ☹  
But thanks for your suggestion!!

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:08am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/4 "2025-05-09T08:08:43Z")

</div>

I mean office online repair tool, but not sure that the issue then…have you tried restart revit and dynamo ? have just tried your excel sheet and works fine here both with import excel and open.xml

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:09am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/5 "2025-05-09T08:09:38Z")

</div>

restarted dynamo a couple of times already - I will restart Revit again…

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:15am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/6 "2025-05-09T08:15:46Z")

</div>

yeah try that, and let us know how it goes…

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:17am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/7 "2025-05-09T08:17:42Z")

</div>

Error still shows up…  
I just don’t know what it means since I just shortened the excel file and did nothing else to anything

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:18am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/8 "2025-05-09T08:18:55Z")

</div>

> [@luckywilf](#):
>
> I just shortened the excel file

Hmmm and thats the excel file you shared ?

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:20am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/9 "2025-05-09T08:20:10Z")

</div>

Yes and thats the original version (just longer)

[Excel\_Test\_V3\_Andreas.xlsx](https://forum.dynamobim.com/uploads/short-url/k70AmB40sV1U8J4haQcjFOmV5sm.xlsx) (22.8 KB)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:21am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/10 "2025-05-09T08:21:23Z")

</div>

and that one works ?

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:22am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/11 "2025-05-09T08:22:56Z")

</div>

yup - works like a dream

 ![No errors - just Dynamo doing its job](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/3/c353c3695f72ba63d839f26151101a842e13361c.jpeg)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:25am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/12 "2025-05-09T08:25:51Z")

</div>

strange, yeah then i dont know whats wrong

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:27am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/13 "2025-05-09T08:27:17Z")

</div>

Not the answer I was looking for but thanks for your time and that you had a look at it! 🙂

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:29am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/14 "2025-05-09T08:29:39Z")

</div>

> [@luckywilf](#):
>
> Not the answer I was looking

yeah i understand, but i cant provoke that issue…if you havent find a way, i will take a deeper look later …good luck

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:31am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/15 "2025-05-09T08:31:55Z")

</div>

Dynamo is just doing strange things here, idk…

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/d/0d67958fc3bf3c191c4f4fe9b2ddcc3b18556df1.png)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:36am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/16 "2025-05-09T08:36:25Z")

</div>

when i look at your first image it seems import excel works and it first have issues in the codeblock you show there…probably im wrong

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [May 9, 2025, 8:43am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/17 "2025-05-09T08:43:58Z")

</div>

ps sometimes it gives this error **“List.Contains failed. Object reference not set to an instance of an object.”** when we have a conflict with packages or addin, but it doesnt make sense if it works on the other sheet

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:44am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/18 "2025-05-09T08:44:28Z")

</div>

Those codeblocks just gives you back the indices of the words so it’s nothing to complicated and I didn’t get any errors at that node for now. So I think it should be fine like that 🙂

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/a/dad88a1944f667c054e897fb98ed8343704cdd1c.png)

---

<div class="post-metadata">

**Author:** ![luckywilf](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@luckywilf](https://forum.dynamobim.com/u/luckywilf)\
**Post date:** [May 9, 2025, 8:45am UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/19 "2025-05-09T08:45:12Z")

</div>

I only have one Add-on installed but beside that, dynamo is completey stock/blank.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [May 9, 2025, 12:38pm UTC](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998/20 "2025-05-09T12:38:21Z")

</div>

It’s going to be really hard to determine the issue if we can’t see your data. What are you feeding the node with the error?

The “object reference not set to an instance of an object” error essentially means that you have at least one input value that isn’t a valid object - likely a null or empty list. Check your inputs for any of these values and clean them up.

> [@luckywilf](#):
>
> Dynamo is just doing strange things here, idk…

You can even see in this image that your output is null. Somewhere you have invalid or null values.

[Next page](https://forum.dynamobim.com/t/excel-import-leads-to-error-object-reference-not-set-to-an-instance/109998.md?page=2)
