I create a counter = 11, this is to write range from cell I11 onwardes where the range is I + counter in for each row activity. And at the bottom after writing the row i add counter = counter + 1. It writes correctly but however it adds in additional rows. I am not sure where is the issue lying?
@mark_rajkumar1 If you are not incrementing your counter within the if then it would increment irrespective of your condition. So you would get additional rows.
This is not a correct way to control where the data is written. You set the Starting Cell property in the Write Range activity to tell it where to start.
If you’re doing this because there is already data in the first 10 rows, then just use Append Range. It’ll automatically start writing the data after the last existing row.
Without more detail I’m not sure exactly what you mean, but if you need to leave some columns empty you just add empty columns to your datatable before the Write/Append Range.
Of course replace those column names with the names of the columns in your datatable, in the order you want them.
The point is you have to get the data in the datatable formatted and arranged the way you want it, then use Append Range to write it to starting at the first available row in the Excel file.