Question regarding DataTables

Hi there, I have this loop that extracts users Applicant Number and Payment Number. I then store that in a DataTable (dt_Extracted) with 2 columns, Applicant No. and Payment No. I then want to write the extracted data into 2 existing columns in an excel file, how can I do that? I have been having trouble doing so and would appreciate the help thanks!

Example of what I want:
image

Use write range activity using your dt_Extracted as the source datatable. Define the range as the ranbge of cells belonging to your existing excel columns. Make sure to unmark, “headers” as you already have header/column names in your existing excel

1 Like

@karsten_delfino

  1. Add Excel Application Scope:
  • Drag and drop the Excel Application Scope activity.
  • Set the WorkbookPath to your Excel file path.
  1. Write the DataTable to Excel:
  • Inside the Excel Application Scope, drag and drop the Write Range activity.
  • Set the SheetName to the desired sheet (e.g., “Sheet1”).
  • Set the StartingCell to the starting cell where you want to write (e.g., “A2”).
  • Set the DataTable to dt_Extracted.
  • Set AddHeaders to False if your DataTable does not include headers
    check the workflow
    Main.xaml (6.9 KB)
    New Microsoft Excel Worksheet.xlsx (7.5 KB)
1 Like

@karsten_delfino,

As you said

Use Append Range activity of Workbook.

Thanks,
Ashok :slight_smile:

1 Like

Hi I tried doing this and it did work but all data in the 2 columns of the datatable wrote in 1 column in excel.

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