There’s a weird thing happening with grabbing some info from an excel file.
In R2024 everything works fine:
In R2025 I just get null for some reason:
I have the latest scripts installed and Iron Python 2.7…Any ideas?
There’s a weird thing happening with grabbing some info from an excel file.
In R2024 everything works fine:
In R2025 I just get null for some reason:
I have the latest scripts installed and Iron Python 2.7…Any ideas?
In Revit 2025, when I need to import from Excel, I do it this way. I’m not sure if it comes from a Node package or if it’s built into Dynamo, but I’ve also added an image related to it.
Can’t really use that in my script since I need the sheet names from the document to push them into a Data Shapes select window…
hi,
here a solution using Python and OpenXML
import clr
import sys
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('DocumentFormat.OpenXml')
import DocumentFormat
from DocumentFormat.OpenXml import *
from DocumentFormat.OpenXml.Packaging import *
from DocumentFormat.OpenXml.Spreadsheet import *
def get_ExcelSheetsName(filepath):
fileStream = System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite)
spreadsheetDoc = SpreadsheetDocument.Open(fileStream, False)
lst_sheetsName = [s.Name.Value for s in spreadsheetDoc.WorkbookPart.Workbook.Sheets]
return lst_sheetsName
file_path = IN[0]
OUT = get_ExcelSheetsName(file_path)
Thank you for that, unfortunately it does not work with the Data Shape Inputs.
input must be a string (file path), which data shape node did you use as input?
When I retrieve the data by specifying the index from the User Inputs output, the Python script does not give an error.
that’s a good shout, thank you for that
The lower branch appears to be passing a string, which means the input needs to be handled differently.