Write Cell: The cell 0 does not exist

Hello all,

I read 2 excel file dtBank, deposit
For Each Row dtBank inside Filter Data dtDeposit to compare Code if equal will write cell: dtDeposit.Rows(0)(“Column17”).ToString

But error Write Cell: The cell 0 does not exist.

Thank all

Hi @anh.nguyen

Try this way:

For Each Row (rowBank) in dtBank
    Assign: codeToCompare = rowBank("Code").ToString

    Assign: matchedRows = dtDeposit.Select("Code = '" + codeToCompare + "'")

    If matchedRows.Length > 0
        Assign: rowToUpdate = matchedRows(0)
        Assign: newValue = rowBank("Column17").ToString
        Assign: columnName = "Column17"

        rowToUpdate(columnName) = newValue
    End If
End For Each

Hope it helps!!

1 Like

Hi @anh.nguyen ,

The Write Cell activity requires to use Cell Ranges or Cell values to be "A1,", "B2", "F3".

But I believe you have passed only the row index or row count in it (Not sure, the Cell Range is not visible).

Also the Excel cell reference starts from 1, so from the Datatable row count, we would need to increment to get the required Excel row number.

Let us know what have you used in Cell Range property and we can correct accordingly.

@anh.nguyen ,

As mentioned and discussed in private. The generation of the Excel Column Names and the Row number identification to Update was updated in the below workflow.
Deposit.xaml (17.2 KB)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.