Delete empty column without header reference





@shruti, Follow these steps,

  1. Read Range - Read excel output to dt datatable.

  2. Assign - Get all column names that has empty rows

Paste the query right hand side and assign it to arr (String Array)

(From col In dt.Columns.Cast( Of System.Data.DataColumn)
Where dt.AsEnumerable().All(Function(x) x.IsNull(Convert.ToString(col.ColumnName)))
Select col.ColumnName).ToArray()

  1. For each - Loop through array with column Names and remove that column from dt

For each item in dt
in body use Remove data column activity set the columnName (item)

Dominic :slight_smile:


is this you told if so, column is not deleting


If you will read excel which is having empty columns at the beginning and at the end. then it is fine.
but if empty columns will come between then you will get default column names like column n (where n will be numbers starting from 0,1,2… so on… and so on.

Note - ignore my comment just missed the part to read all empty rows :stuck_out_tongue:



@shruti, Can you post the before and after pics what you are getting now ?

Tested from my side its working as expected !

Dominic :slight_smile:


Done bro :slight_smile:

Dominic :slight_smile:


no changes in excel sheet


Can you share your xaml file


@shruti, Its really surprising ! I think you have implemented everything perfectly.

Finally confirm your data variable type (it should be a string array).

Note: I couldn’t upload my Xaml due to security concern, else I would have done it before !

Dominic :slight_smile:


yes it’s string only :frowning:
okay i will check it once again Thank you



find the attached sample for u - Shruti sample.xaml (10.1 KB)



@aksh1yadav, May I know why it wasn’t working before ? Any ideas ?

Dominic :slight_smile: