How to keep only one row at a time in excel

there is datatable :- name,age,place
abc,21,CHE
xyz, 23, MUM
lmn, 25, KOL
and so on

i need to create separate excel for every row and give that excel name as per name present in data.

is it possible

1 Like

Yes It was doable @Vikram212

I will create a scenario for these.

cheers :smiley:

Happy learning :smiley:

@Vikram212

Scnario
1.Use Excel Application Scope Activities
2.Use ReadRange Actvites.
3.Create Variable in The variable pane with datatable type.
4.Assign the variable in ReadRange Activities Output.
5.Use ForeachRow Activities to iterate in the dattable
6.Then Use Excel application Scope again to create new Excel file.
7.Option you can use Write cell to write the value in your desire row and column in excel.

If you want to create different Excel file Just create a string variable and pass it to the second Excel Application Scope to create a dynamic Excel File path and also the filename of the excel.

I hope this might be helpful to you.

cheers :smiley:

Happy learning :smiley:

1 Like

After creating excel files I need to write that particular row in that particular excel file with header

So according to the above example
The first excel file should be named as abc
And its contents shud be
Name Age place
abc 21 CHE

Fine
Hope these steps would help you resolve this
—use excel application scope and pass the file path as input
—inside the scope use a read range activity and get the output with a variable of type datatable named dt
—then use build datatable activity and create the same structure of table column as in excel and get the output with a variable of type datatable named Finaldt
—followed by that use clear datatable activity and pass the above variable Finaldt
—then use a for each row loop and pass the variable dt as input
—inside the loop use a add Datarow activity and mention the ArrayRow property as row.ItemArray
And in datatable as Finaldt
—now use a WRITE RANGE activity from workbook activities and mention the file path of the excel and sheetname as row(0).ToString and input datatable as Finaldt
Also ensure that Add Headers property is enabled

—next to this write range activity use Clear datatable activity And mention the input as Finaldt
While still being inside the for each row loop

This will create the output excel as you expect
Kindly try this and let know for any queries or clarification
Cheers @Vikram212

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.