Append Range:Add Headers

I want to append the data in excel.
so, I’m using append range workbook activity and I need to add headers(col name) how to do that?

Hi @AbarnaKalaiselvam ,
You can add column before append range
Or you can write cell name of column to workbook before append
Regards,
LNV

@AbarnaKalaiselvam

If you’re looking for an alternative method to append data with headers to an Excel workbook in UiPath, you can use the “Write Range” activity combined with some additional logic. Here’s how you can achieve this:

  1. Read Existing Data (Optional)
  2. Create New DataTable
  3. Merge DataTables
  4. Write Merged DataTable to Excel

Method - 1: Create an excel before running and then add nessecary headers

Method - 2: If your running first time or first transaction use write range and for the next subsequent transactions use append range

Method - 3: After Build datatable use write range to add column headers and then append data to it

@AbarnaKalaiselvam

If you are using the extract data table store the data in a variable and pass that variable in append range workbook activity so that all the data will be appended to the existing workbook with the column headers.

If you are using the read range work book then mark the add headers check box true and then use the append range workbook so that all the data will be appended to the existing workbook with the column headers.

Hope it helps!!

@AbarnaKalaiselvam

Create a workbook and include headers in it.

Then use below if condition -

if File Exists(Your File Path) then Use Append Range

else Use Write Range and check in the header option

Cheers!

Hi
is there any data available before going to append or can you explain more about it

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.