Is possible to use the Export to Excel OOTB node in Python?

Is possible to use the Export to Excel OOTB node in Python?

I tried this so far but error:

clr.AddReference("DSOffice")
import DSOffice
from DSOffice import *

filepath=IN[0]
sheetName=IN[1]
data=IN[2]
overWrite=True
starts=0

OUT = DSOffice.Data.ExportExcel(filepath,sheetName,starts,starts,data,overWrite)

image

@ruben.romero ,

I did here something similar, finaly i did not test it already

Looks like you have a single depth list instead of a list of lists.

1 Like

I got a list of sublists

This is the solution I found testing by myself with this reference How to use Data.ExportExcel method in a python scipt - #4 by leonard.moelders

#Export the data to Excel
import clr

import System
from System import Array
from System.Collections.Generic import List as IList

clr.AddReference("DSOffice")
import DSOffice
from DSOffice import *

filepath=IN[0]
sheetName="lolol"
dataIn=[[2,1,3],[2,1,4],[4,4,3]]
overWrite=True
starts=0

list = []
for l in dataIn:
	list.append(Array[object](l))

listDataIN = Array[Array[object]](Array[object](list))

OUT = DSOffice.Data.ExportExcel(filepath,sheetName,starts,starts,listDataIN,overWrite)