¿How to customize excel files with dynamo and Python...?

Very good days.
I am trying to customize my excel file which is result of information exported from revit with dynamo.
I would like to customize it from python code so that when you open it in excel it is already with all the necessary format.
Somebody could help me.

I attach an image of I would like the result to be.

You will have to use Microsoft.Office.Interop.Excel in python. Use the search function in the forum and plenty of results will come back.

You can write the data out to a separate sheet and set up the formatted view in advance by referencing the data sheet.

2 Likes

This sounds pretty interesting Jacob. Do you mean having the format for the headers ready and insert data after these headers?

Yes, or insert the data on sheet 2 and have sheet 1 read the relevant information from sheet 2.

Yes, I understand but it is not feasible since the information in the table will always vary in position, sometimes it will be rows of 100 or perhaps 10,000.
The idea is that every time you find the word OE in column A, you understand that you must assign a format to it.

Do you have a graphic that helps me understand your idea?

Section A and section B can be written in different sheets as well, allowing you to bulk pull the data or even use a table for the lower section of data.

Unfortunately I don’t have such a diagram or a collection of data sets with which to build one.

Hi @AM3D ,

Like Jacob said, i would recommend using an existing Excel file as template and then just copy that file to write the data into that. If that doesnt work for you, you can also look into the BumbleBee Package, then you can format your excel straight from Dynamo.

1 Like

I have been able to select these indexes which are the rows in the excel file and apply a modification to them such as the type of bold text, color and a background color.

You could also create these filters inside Excel, I think that, that would be a lot easier :smiley:

Use Bumblebee or create an excel template with the formatting inside, you can write to. here is a way how you can write to a template…