title: UIPath - Get a single row of a datatable and write it in Excel
body: <p>What's the best way on UIPATH to get a multi column row of a Datatable and to write it on Excel.</p>
  <p>I'm in this situation :</p>
  <ul>
  <li>I converted an Excel table into a Datatable with <strong>ExcelReadRange</strong></li>
  <li>I'm using a <strong>ForEachRow</strong> loop to get every row of my datatable</li>
  <li>inside this loop I'm using an <strong>ExcelWriteRange</strong> activity to write each row on the <strong>same</strong> range of my Excel File. (so yes I replace the row at each turn of my ForEachRow loop)</li>
  </ul>
  <p>But I get the next error :</p>
  <blockquote>
  <p>Impossible to convert a <strong>System.Data.DataRow</strong> to a <strong>System.Data.DataTable</strong></p>
  </blockquote>
  <p>So I made a new Datatable with <strong>BuildDataTable</strong> and used <strong>Add Data Row</strong> and provided the target row. Thanks to that I can provid the new Datatable to my <strong>ExcelWriteRange</strong>.
  But it's still not working and I get this new error :</p>
  <blockquote>
  <p>This row already belongs to another table</p>
  </blockquote>
  <p>What's the solution to write row by row my datatable in Excel ?</p>