How to add 2 columns at the end of all the columns. If the column index is unknown, how to add the columns at the end
- Read Range Activity: Use the “Read Range” activity to read the data from your Excel file into a DataTable. Configure the activity to read the desired range from your Excel file and store the output in a DataTable variable (let’s call it dt).
- Add Data Column:
- Add an “Add Data Column” activity.
- Configure the activity as follows:
- DataTable: dt
- Column Name: “NewColumn1” (You can change the name as needed)
- Data Type: System.String (You can change the data type as needed)
- Default Value: Leave it blank or specify a default value if needed.
- Add another “Add Data Column” activity for the second new column:
- DataTable: dt
- Column Name: “NewColumn2” (You can change the name as needed)
- Data Type: System.String (You can change the data type as needed)
- Default Value: Leave it blank or specify a default value if needed.
- Write Range Activity: Use the “Write Range” activity to write the updated DataTable back to your Excel file. Configure the activity to write the DataTable dt to the desired range in your Excel file.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.