Remove data row in Excel

Hi Everyone,

My need your help to solve below issue.

  1. Open excel and read AG colum contents
  2. if AG column values contains “na”
  3. delete that data row from excel - do it for all rows
    4.save workbook
    5.Do the same for next excel file in directory

I have tried to use “Remove data row” activity inside for each inside excel application scope but it didnt work.

Can someone suggest better way to do this ?

Hi @Lawrance_A

I think you need to read a dataTable from excel and then outside the excel application scope you apply the remove data row on the retrieved dataTable and then you write the resulting dataTable to a new excel (or even replace the old one with the new one using the same path)

Regards,
Reda

if i replace with old one the i may need to delete the old contents completely right ?

Tried it but getting below error.

Hi again @Lawrance_A

are you working with a version of uipath that is greater than 2018.2 ?

If this is the case work with this project, I used filter dataTable instead of for each to delete “na” rows

ExcelDeleteNARows.zip (16.7 KB)

Hope it helps.
Regards,
Reda

hello @Lawrance_A
can u try with select query using data table , filter dat data and write in excel
dt=dt1.select("[Column1]" != ‘na’ ").copytodatatble() write in assign activity