FLM.xaml (6.8 KB)
Seems like everything is going on right…
I have used a message box and it shows everything is cleared except the header
FLM.xaml (6.8 KB)
Seems like everything is going on right…
I have used a message box and it shows everything is cleared except the header
@Sweety_Girl if i execute in excel file, i do not see the results using write range activity.
Will you able to get the same results in excel file i.e. everything cleared except headers.
FLM (1).xaml (7.5 KB)
I have added a empty row using add data row… and wrote in excel…
It works… try it
we do not want add rows, just clear entire rows after headers, i tried as not getting desired resultsTestfile.xlsx (10.9 KB)
FLM.xaml (7.0 KB)
Do u need to write in that same excel
@Raj_Nadar I guess you need to use Delete Rows Activity inside Excel Application Scope with Position as 2 and No. of rows as the DT.Rows.Count
Yes, same table we wanted to clear except header
U can use this Clear sheet VBA code and then use write range activity,
VBA code,
Sub ClearEntireSheet()
Sheets(“Sheet1”).Cells.ClearContents
End Sub
1.I think if your datatable is not having any rows and you try to write range it … You will not get anything.
You can try by putting one sample row and verify above point.
If you want only One row of data , using the Build DataTable I can insert one Row with the Data Required (Header and Data can be Same) and then in Write range - I can write DataTable Without Header
We can have a below logic in place
we can create 2 DataTable - one with only Header - dtHeader
other with Header and one Row of Data (Same as Header) as shown in above threads -dtHeaderRow
3.Then we use an - IF Statement here and Checking the Datatable row count.
–
Mukesh
If one wants to delete excel rows, using an empty Data Table to write back (overwrite) the excel will never work as UiPath will see it is an empty table and not do anything with it…
I think that you will just want to use “Filter Data Table” instead of “Clear Data Table”. It sounds weird, but if you set it to filter to “Keep” something that it will never find, it will always just return the headers without any of the data.
For example, I set it to Keep a row only if it is and is not empty so it automatically just leaves the header: