Deleting Excel rows regardless of its contents


#1

Hi,
I want to delete first few rows from an excel file regardless of the data it contains. Can anyone suggest me a solution please. Thanks


#2

@suwalruchan365

  1. Read data from excel assign output to datatable.

  2. use foreach row on that datatable.

  3. Take if condition and check the row number is less then ur value. If it is less use delete datatable row to delete row else do nothing.

  4. after for loop write datatable to excel


#3

Hi @Manjuts90,
Thanks for your answer. If you don’t mind, can you post a sample workflow please. Thank you.


#4

@suwalruchan365 try below xaml file and find sample excel file.

del-------------.xaml (9.0 KB)

sh2.xlsx (8.5 KB)


#5

Hi @Manjuts90,
I used your workflow but it’s not working as I wanted. I have attached my sample excel file herewith where I want to delete all the contents up to row 11. Can you help me with this please. Any help would be much appreciated. Thank you.

Sample.xlsx (10.3 KB)


#6

If you want just clear content of this 11 rows do this.

If you want remove rows than probably better use Invoke code activity.