UiPath not writing excel properly

Hi all,

I’m currently running a code to read PDFs, take their fields and fill up an excel sheet. However, the output is written at a low which is v much lower than the header row (ideally should write to the 2nd row and so forth). I suspect the problem is with the datatable as it cannot be cleared but keep crashing as i try to debug it. Any idea how I solve this problem?
I have attached the code & excel sheet for reference.
Main (1).xaml (39.5 KB)
Identifier No. tracking for forms (1).xlsx (20.4 KB)

  1. read your Excel in datatable
  2. after reading get max used row by datatable.rows.count and save in variable
    3 now write in excel using write range and set range as A + your max variable