Delete column range from datatable

Hi,
I have a datatable where I have to delete multiple columns and column range DQ:EA. What is the fastest way to do that with assign activity? I don’t want to use invoke vba because the excel has over 200 000 rows and it is very slow.

@markosc

you can use Insert/Delete Columns Activities
Forum0615_DeleteColumn.zip (20.1 KB)

NoColumns : Number of Columns to delete
Positon: From what Column

but how can I do it without excel app scope?

In Manage Packages, download UiPath.Excel.Activities


or Do you use StudioX? I think UiPath.Excel.Activities is default in Studio.

I have the Excel pachage and I’m using Studio. I need to delete column range in Datatable and I don’t want to use Excel App Scope because it takes too much time to do that.

Hey there!

One way to achieve this would be to identify the starting index of the first column to be removed and then invoke “Remove Data Column” with that index as many times as needed.

Kinda like:

Where the end result is a reduction of columns from ABCDE to AB.
Can’t think of a one-liner for this off the top of my head, especially since the DataTable.Columns property cannot be set directly, and methods associated with removal etc. do not have a return value and therefore cannot be stuck into a Assign activity directly.

Hope it helps anyway and all the best
Markus