I have an xlsx file with 7 columns, and I would like to copy 3 of the columns (including headers)to a newly created file. However, I’ve been having problems with “Write Range”.
Use the Read Range activity to pass the values into datatable and delete the columns that you do not need using DataTable.Columns.Remove(“columnName”) and then use Write Range activity to the excel file that you want fill.
Or
Use the Read Range activity to pass the values into datatable use for each row activity to add the values by columns to another datatable and then write it into the other excel file.
1.Use Read Range Activity and create output data table variable(DT).
2.Use this syntax for selecting specific columns use assign activity DT1=DT.Select().CopyToDataTable.DefaultView.ToTable(True,“Customer ID”, “Customer Country”, “Phone Number”, “Quantity”)
3.Use Write Range Activity check add headers in properties pass the data table variable.