Writing to Excel - multiple sheets one node

I’m writing a fairly complex Dynamo Code for a company I work at and I’m in the final stages of the program, I’m looking to write to Excel. i’m aware of Bumblebee but don’t want to use it because it does not support live write AND closed document writing at the same time. (I want both features as options) I want to write different data to different sheets of the same file. Is is possible with one Write to Excel node without using the Bumblebee add in. A side note, the number of sheets I would be writing to is different for every project, so simply creating many write to excel nodes would not work since there’s no way to tell how many I would need… anywhere from 5-100 sheets will be written depending on the project. I am running Dynamo 1.2.1.

I think that feeding matching depth lists into a code block would allow for this function but I haven’t tried it myself with unknown lengths.

Can you post a sample of what the data structure might look like so we can work with a common set? Maybe a Math.Random node into a list of repeated items node?

1 Like

What @jacob.small said about matching list depths usually works from my experience. You may have to repeat data but feeding the node 100 sets of inputs should result in 100 sheets.

So there’s my data (not broken down into rows and columns, I was first working with just a row of data to get my bearings, this is my first time writing to Excel). the top node represents the sheet I want to write, the bottom node is the data. You cant see it in the photo, but there is 4 total lists (0,1,2,3) of data. But each subset of data will change in length depending on the project, as will the total number of sheets/data sets.

Is it as simple as I need to write the data array in 3 dimensions? I can get multiple sheets to write, but they are being all filled with the same data sets…

Is it possible to see the example excel either post a file or screen shot showing the tab excel name and data screen shot from each excel tab. Just want to see your end product. Tnx

Unfortunately this is a company project so I am not at liberty to release the entire file, or shot of the whole page… I’m not to worried about getting the data to output the way I want. I don’t have an issue with manipulating lists. The problem again is in the fact that I want to write to different sheets, with different data, and every time the code runs, the number of sheets is subject to change.

Just to show that this is possible.


image image

Just make sure you have the same number of data inputs as you do sheetName inputs.

1 Like

This generates your files either with nodes or with a codeblock. The code block is much more stable and efficient in my opinion.

1 Like

Hi your in luck…if above solution form Jacob and Nick does not solve your topic. Look at this

One of the graph will solve your query…saves me from trying it out…enjoy…

1 Like

Is “Excel.WriteToFile” still a valid node?

Depends which version you’re working with.
…but probably not.
The workflow probably won’t be any different though.

1 Like