Add a New Column to the Existing Excel Sheet which is created already

How to add a New Column to the Existing Excel Sheet and the new Column should contain value as “Bike” till the Record present in Current Excel ?

Thanks in advance,
Jayavignesh G

Hi @Jayavignesh_G
You can try this way in a single invoke code activity
read the excel and store in dt1

use invoke code activity with argument as dt1 In/Out
then use the below code

dt1.Columns.Add(“Data”)
dt1.AsEnumerable().ToList().ForEach(Sub(row) row(“Data”)=“Bike”)

Then write it in the excel sheet again as write range (dt1 itself)

Here I had used Data as name of column , you can change it as u need

Regards,
Nived N

@NIVED_NAMBIAR Do i need to Covert the Variable “Dt1” into Argument(In/Out) Correct ??
If yes, then i need to Create a “Variable” with datatype “System.Database” in Process Transaction and pass the value for the Process Transaction Argument ?

Hi @Jayavignesh_G
for getting a clear idea,
refer this workflow
process1.zip (3.4 MB)

Mark it as solution if it helps

Regards,
Nived N
Happy Automation

1 Like

It’s working …You are awesome. Thank you so much !!

1 Like

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