Get the total count of files and paste that in excel

Hello community!


How can i paste the total count of this files in excel using write cell activity?
Example the count is-138
So i want to paste that count under the total count column
How can i do that?

hi @Priyesh_Shetty1

You can write Formula using Write Cell:
“=Sum(A2:E2)”

@Priyesh_Shetty1

Use write cell (“=Sum(A2:E2)”) and then use Autofill range activity

Hi @Priyesh_Shetty1

Give like this

image

Hi @Priyesh_Shetty1

Use the for each row excel to iterate for every row.
Take a assign activity and create a variable like Totalcount inside for each row activity.

Assign -> TotalCount = Cint(Currentrow("CAMS"))+Cint(Currentrow("CVLKRA"))+Cint(Currentrow("DOTEX"))+Cint(Currentrow("KARVY"))+Cint(Currentrow("NDML"))

The Totalcount variable stores sum of all files.
In what to write field pass the Totalcount variable.
In where to write field give like this

Currentrow.Byfield("Total Count")

Check the Auto increment option.

This process is used for further use if any rows are added to this excel file.

Hope it helps!!

@lrtetala does not work

@Priyesh_Shetty1

It is working please try

I have taken sample data

image

@lrtetala Showing error workbook path needs to be set.

Hi @Priyesh_Shetty1

Try this:

@Priyesh_Shetty1

Once show your code

Hi @Priyesh_Shetty1

Aren’t you setting the workbook path in write cell workbook activity?

Without it, it won’t work.

OR else if you’re using Excel Application Scope, you can use write cell activity.

Hello @Priyesh_Shetty1

Follow the below workflow


Demo.xaml (13.9 KB)

Hope it helps!!

@adiijaiin


I have write range to write all the count of the files and before add data row i have used add data column…I have created a variable dt with a value of new.system.data.datatable()

screenshot isn’t visible

Hi @Priyesh_Shetty1

You are using the add data row activity which add the new row to the datatable.
Use the excel activities to achieve the solution.
Demo.xaml (14.4 KB)

Hi @Priyesh_Shetty1

You can simply use this logic for whatever the range of excel column is:

@mkankatala iam add data row for that cams karvy ndml dotex folders count…Not for total count

If you will add data row the new row will add not write the value to the total count.
Hope you got it.
please refer the xaml file that I attached.

@adiijaiin @lrtetala @supriya117 The each folders count which i have pasted and at last i have paste total count column…Is there anything else to get total count?..Because the folder are not fix sometime there will be only 2 folder’s some time there will be 3 folder like that.
Example-CAMS-43,Karvy-23 like this it will be.