Error using columns(input1.Columns.IndexOf(col)) + (input1.Rows.IndexOf(row)+2).ToString

I have a workflow that takes information from the web and a file in excel and pass it to another file, however the initial excel file already contains data, I made it a condition for it to recognize the cell that is empty and impute the data, however error in write cell.
can anybody help me?

@Beatriz what columns variable contains.

can u post range section value here?

@Beatriz Instead of identifying the cell empty you can use Append Range Activity
all you have to do is,

Step 0: By using activity Build DataTable create one DT.
Step 1: Take the data into variable [ The data you want to write it in excel ]
Step 2: By using Add Row Activity assign that data to a DT.
Step 3: Outside the loop use Append Range and pass that DT.