i wanted to delete a row from an excel if a condition is satisfied.i used “delete/insert row” activity with inside the excel application scope .I want the activity can use outside the excel application scope.
Anyone pls help?
1 Like
Hi @ASWATHY_K ,
Alternately, using the Datatable methods, We should be able to delete the row from the Excel, But provided we would require to clear the sheet and update the Sheet with the Filtered values from the Datatable.
You could try following the below steps :
- Read the Excel sheet as a Datatable, say
DT
. - Filter the Datatable, so that you keep only the rows which are Required, and the result is stored in
FilteredDT
. - Next, You can use
Write Cell
Activity to delete all the rows present in the Excel sheet. With Range as"A1:E"+(DT.Rows.Count+1).ToString
and value as""
(Empty String) . - Next, Use
Write Range
Activity and write theFilteredDT
to the same sheet.
For cases, where you do not know the Last Column Name, you could refer this post, as the below post also describes on clearing the Sheet without Excel installed.