Hi all,
i need to append my datatable to an existing excel file, my issue is that i have a column named “invoice” in my dt and “invoice number” inside the excel file.
How can i manage that?
Column name should not matter with Append Range activity. Just use Append Range activity and pass DataTable to append it to existing Excel data.
so the important is the order of column?
In this case, how can i add column after a specific column?
Are columns same order in both DataTable and Excel file ? If not then Append Range activity won’t help you.
not all columns are in the same order, because i need to add some columns in my data table(add data column) but these are created at the end, while in the excel file are in the middle
the error now is: Root element is missing, any idea about this issue?
Hi
To take it very simple
Let’s add the number of columns we want with the help of ADD DATA COLUMN a activity and if we want to change the name of the column then a assign activity with this expression would help you resolve that
dt.Columns(“yourcolumnname”).ColumnName = “new column name”
And you can use APPEND RANGE activity
In order to sort the columns, Use Filter Datatable Activity, And in Output Columns Section, Assign the Column Names in the Order you need it.
To include a column in any position of a datatable
Hope this would help you
Cheers @andreus91
Thanks @Palaniyappan ,
is possible to do the append range if dt1 has less column than the excel file?
Excel have 20 rows, my DT 15, can i append range or i need to add 5 blank column?
It should have same number of columns and order of columns as well
Cheers @andreus91
Thanks @Palaniyappan,
i’ve always the same problem with append range: the given key was not present in the dictionary, even if the append still working, otherwise it change the name of the column in another excel sheet.
I’m using the workbook append range, could the filter in excel file be te problem?