Data.OpenXMLImportExcel node Error when importing

Hello Guys,

i am faced once again with the excel-dynamo import phase problem. I keep getting the error which states: The object reference has not been set to an object istance. Please does anyone have an idea of how to solve this issue without using the file Path node which always crashing revit/dynamo entirely when used. Thanks

1 Like

Try with file from path.

Hi Vijay, thanks alot for the swift response. The Problem is that the node file path does not work with me because it crashes my revit and respectively dynamo when i connect it or even click search. that was why the openxml was the only option that has succesfully worked while i did the export. So the thing is that i need a work around to get the file from the saved location without using the file path node. thanks lot

Got it. Alternatively, you can use Python to import the data

import clr
import System
from System.IO import FileInfo
import DSOffice

# Take path string from Dynamo input
path = IN[0]

# Convert to FileInfo object
fileInfo = FileInfo(path)

# Import Excel
data = DSOffice.Data.ImportExcel(fileInfo, "Sheet1", False, True)

# Output to Dynamo
OUT = data

you can try with use Crumplev also. it working as excepted.

1 Like

You need to escape your back-slashes in the file path or use a forward-slash

3 Likes

Thank you so much @Mike.Buttery by just escaping the back-slashes solved the problem so fast. This forum is simply the best so far. Thanks you Sir for the support.

1 Like

Hello, can this help?

1 Like

Noting I retired those nodes in favor of a set that uses pandas.

Hello hayet, i believe this solution was directed to me however, i had solved it using the suggestion from Mike.butterfly. Thanks for your help as well.

1 Like