Excel is overriding when i am passing one loop variable to another loop


i am creating excel by fetching json and storing in one folder.
when i am passing item variable of one main loop to inside loop it is showing me result as i am doing write line for that variable but when it is creating excel it is overriding , taking only last value and creating
check following pics .

@ppr @hasib08 @carmen @Cristian_Negulescu @Palaniyappan @reda @AndersJensen @Adrian_Star @jitendra_123
please help me to resolve this issue.

was write range used? Overwriting data often occurs in case of apprend range is not used

doing like this.
using excel application scope and write cell.

may we ask you on details for the yellow marked part

we would expect a range setting like B2,B3…

yes it is like “B”+ManagerCnt.ToString where i am setting manager counter before loop as 2 and increasing inside loop after write cell as +1 as i have to write values form b2 cell in excel

in For Each properties assign variable to output Index = eg. idx


Then inside loop when you inovking Write Range set:

 "B" + CStr(idx+2)

My case eg.:

yes i did but still it is overriding

If not necessary, do not use Write Range for Excel Application Scope,
Use Write Range from File> Workbook.

It is faster because it does not require opening Excel.


And if you need to use Excel Application Scope also pay attention to what parameters you have set.
Correct use of the Excel Application Scope activity also requires you to add the Close Workbook outside of Excel Application Scope activity:

yes i am closing my workbook also after ending each iteration .when i am observing it is creating both files in debug but at last only one file is there in folder which is last file.

I understand that the keys are not in line and the values are added randomly to different files ?? Ie. the file is not completed immediately with the full data set?

If so, that’s why it overwrites your data, because you probably clear the counter every iteration. And the numerator then starts counting from the beginning. Right?

First, make files for each of the keys separately, and then read each “key file” and save it to the appropriate “final file”.