Help me write data in excel in below scenario

I have a excel file with column with name - Ship name

I read this excel using read range and output data table is DT

now I have a string like - name = “MT”

am getting error when I am writing this value inside escel using assign like this

DT(“Ship name”) = name.tostring

1 Like

You have to specify which row you want to update.

it will be DT.Rows(X).Item(“Ship name”) = name.tostring

X is the row index you wish to update in the datatable.

1 Like

Hi @Gaurav07

Tried to iterate in the loop and make the changes in the dataable.


something like that to update the datatable.

Also you can follow what @TimK shared . :smiley:

cheers :smiley:

Happy learning :smiley:


Thanks and in the end I have to use write range to write the assigned values to the excel file

1 Like

I am getting this error

RunData.rows(Runcount).item(0) = ShipName.ToString

1 Like

What are you assigning Runcount as? it should start from 0 index.