Write Cell Range -Activity not working properly

I am using the Write Cell range activity to write down in a column whenever there is an exception, I have also ticked the Auto-Increment option but it always just writes it in the same cell, it is not incrementing.
What I am doing wrong?

Hi @Sami_Rajput

Did you using this activity inside the for each Excel row activity If yes.

Then in the where to write field give like below

CurrentRow.Byfield("Column name")

In the double quotes give the specific column name. If you use this activity inside the for each Excel row activity then only it will write all the rows.

Hope it helps!!

1 Like

@Sami_Rajput

I guess you are using it inside some
Exception and in re framework or some where… auto increment works only inside a for loop and below condition

Hope this helps

Also it increments only if used continuously in the loop…if used only in exception and not used without it then it wont increment as expected

Cheers

1 Like

@Anil_G
Yes, I am using it inside try Catch block,which is wrapped inside the For-Each Excel row activity, so whenever it throws an excption it should write in the excel sheet.
So what could be the solution then

@mkankatala Ok, I’ll try this.

1 Like

@Sami_Rajput Make sure to place the write cell activity inside the for each Excel row activity only.

Hope you understand!!

1 Like

@Sami_Rajput

If inside for each row in excel then use currentrow.ByField("ColumnName") this makes more sense

Or currentRow.ByIndex(7)

Cheers

1 Like

Is it working for you @Sami_Rajput

If yes Make mark it as solution to close the loop.

Happy Automation!!

Im having issues with the autoincrement in the write cell activity in UiPath as well.

I have an If activity inside my for each row activity, and it somehow keeps writing on top of previously input data instead of below in excel. Is there any way to fix this?