Getting Error While using assign activity for changing the column name

Assign: Exception has been thrown by the target of an invocation.
I am getting the following error while using the activity for changing the column name into read range activity
dataTable.Columns(“old_ColumnName”).ColumnName = “new_ColumnName”
I am using this query for the same

Hi @Kunal_Jain ,

Is the Datatable already having the Data ? Is the Column Name the same as present in the Datatable or Excel Sheet ?

Yes datatable contains the data
and the column name is also same as present in data table.

@Kunal_Jain ,

Could you show us the Screenshot of the Workflow ? Also, Could you Debug and check in immediate Panel, the value of Datatable and send it’s screenshot ?

The Assign should work if the Datatable is already initialised with Data.

check this out

Hi @Kunal_Jain

Try this

  • Excel Application Scope
    • LookUpRange save the cell address
    • Write cell new column name in the above cell address
    • Read Range and save to the datatable


@Kunal_Jain , We would require to know the Datatable Headers through the Immediate Panel.

I cannot share that data with you
But it contains string value of around 2-3 columns and 2 date columns

Here check this out

Can anyone help with this??


@Kunal_Jain ,

Could you try changing the column names for some other column other than the one you have already used, Check with the column Name which doesn’t have a Space.

There was a same column in the sheet that was creating the error
While using the query just check the column does not contain the same name column that you are assigning.