Search code examples
excelexcel-2007uipath

UiPath - Options - Add Headers within Read Range adding excel column headers while unselected and not adding column headers while selected


New to UiPath. I am trying to read a .xls file and write the contents within a .xlsx file. It seems:

  • When Options - Add Headers within Read Range is unselected headers are copied from .xls file to .xlsx file.
  • When Options - Add Headers within Read Range is selected headers are not copied from .xls file to .xlsx file.

Snapshot of the control:

AddHeaders

Am I missing something here?


Solution

  • The Read Range activity reads data into a DataTable object. Checking AddHeaders makes sure that columns are present in said object. Here's an example - Read Range writes items into a variable called items of type System.Data.DataTable, and the Write Range activity writes that table back to an Excel (XLSX or XLS) sheet.

    enter image description here