# Add data colum in excel without using invoke method

**URL:** <https://forum.uipath.com/t/add-data-colum-in-excel-without-using-invoke-method/170602>\
**Category:** Help\
**Tags:** datatable, question, excel, system, activities\
**Created:** [November 22, 2019, 7:03am UTC](https://forum.uipath.com/t/add-data-colum-in-excel-without-using-invoke-method/170602 "2019-11-22T07:03:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phalguna\_M](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/phalguna_m/32/66366_2.png) [@phalguna\_M](https://forum.uipath.com/u/phalguna_M)\
**Post date:** [November 22, 2019, 7:03am UTC](https://forum.uipath.com/t/add-data-colum-in-excel-without-using-invoke-method/170602/1 "2019-11-22T07:03:06Z")

</div>

1: read an excel file with 10 sample rows

2: The excel file should contain Name , Email , Age, Address

3: If the user age is \>40 You need to print or add a data column(Age Band/Status) in the Datatable the guy(Nmae of that person) old without ivoke method

4: delete the age column  
5: Write that excel in other file

---

<div class="post-metadata">

**Author:** ![KarthikByggari](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/karthikbyggari/32/430060_2.png) [@KarthikByggari](https://forum.uipath.com/u/KarthikByggari)\
**Post date:** [November 22, 2019, 7:12am UTC](https://forum.uipath.com/t/add-data-colum-in-excel-without-using-invoke-method/170602/2 "2019-11-22T07:12:30Z")

</div>

Use the inbuilt activity to add the column to a data table

> **[Add Data Column](https://docs.uipath.com/activities/docs/add-data-column)**
>
> UiPath.Core.Activities.AddDataColumn Adds a DataColumn to a specified DataTable. Here you can see how the Add Data Column activity is used in an example that incorporates multiple activities. Properties Common DisplayName - The display name of the...

```
ForEach row in DT
  If Int32.Parse(row("Age")) > 40 Then
    row("Status") = row("Name") + " is Old"
 End If
End For

```

And delete the Age Column using Remove Data Column Activity -

> **[Remove Data Column](https://docs.uipath.com/activities/docs/remove-data-column)**
>
> UiPath.Core.Activities.RemoveDataColumn Removes a DataColumn from a specified DataTable. Properties Input DataTable - The DataTable object from which the column is to be removed.ColumnIndex - The index of the column to be removed from the column...

Use Write Range activity to write the final data table to a new file.

Regards,  
Karthik Byggari

---

<div class="post-metadata">

**Author:** ![phalguna\_M](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/phalguna_m/32/66366_2.png) [@phalguna\_M](https://forum.uipath.com/u/phalguna_M)\
**Post date:** [November 22, 2019, 7:16am UTC](https://forum.uipath.com/t/add-data-colum-in-excel-without-using-invoke-method/170602/3 "2019-11-22T07:16:01Z")

</div>

can u send me this main.xml

---

<div class="post-metadata">

**Author:** ![KarthikByggari](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/karthikbyggari/32/430060_2.png) [@KarthikByggari](https://forum.uipath.com/u/KarthikByggari)\
**Post date:** [November 22, 2019, 7:19am UTC](https://forum.uipath.com/t/add-data-colum-in-excel-without-using-invoke-method/170602/4 "2019-11-22T07:19:07Z")

</div>

Okay.

---

<div class="post-metadata">

**Author:** ![phalguna\_M](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/phalguna_m/32/66366_2.png) [@phalguna\_M](https://forum.uipath.com/u/phalguna_M)\
**Post date:** [November 22, 2019, 9:21am UTC](https://forum.uipath.com/t/add-data-colum-in-excel-without-using-invoke-method/170602/5 "2019-11-22T09:21:32Z")

</div>

u have done this
