Check this xaml, it will delete last two rows in a excel dynamically, you have to change the excel file name before run it. DeleteRowsInExcel.xaml (6.4 KB)
Fine
to delete the last two rows alone once after getting the dataatable variable with a simple assign activity that can be done datatable = datatable.Asenumerable().Take(datatable.Rows.Count-2).CopyToDatatable()
and after this we can write this datatable to a excel with WRITE RANGE activity
and to convert the xlsx to xls we can use MOVE FILE activity, with path property mentioned as your xlsx file path and destination like this “yourfolderpath\”+path.GetFilenameWithoutExtension(your xlsx filepath)+“.xls”
but using MOVE FILE may lead to file getting corrupted
so we can use READ RANGE activity and get the output of the datatable we want and use WRITE RANGE activity where pass that datatable as input and mention the filepath with filetype as .xls
that would work fine without any error…ensure that ADD HEADERS property is enabled in the property panel of write range activity
Cheers @SauravYadav