how to write data in excel sheet from data table and append it when i get new data.
- Use the “Excel Application Scope” activity to open the Excel file.
- Set the
WorkbookPath
property to the path of your Excel file. - Use the “Output” property to store the Workbook variable (let’s call it
workbook
).
- Read the existing data from the Excel sheet into a new DataTable.
- Use the “Read Range” activity within the “Excel Application Scope”.
- Set the
Range
property to specify the range of cells you want to read. - Store the output in a new DataTable variable (let’s call it
existingData
).
- Merge the existing DataTable with the new data DataTable.
- Use the “Merge Data Table” activity.
- Set the
Source
property toexistingData
. - Set the
Destination
property to the new DataTable that contains the new data.
- Write the merged data back to the Excel sheet.
- Use the “Write Range” activity within the “Excel Application Scope”.
- Set the
Range
property to specify the range of cells where you want to write the data. - Set the
DataTable
property to the merged DataTable.
Hi @T_Y_Raju
Write the data into the Excel sheet using the Write Range activity. Whenever you get the new data, use the Append Range Workbook activity to append the data to the same sheet.
Hope this helps,
Best Regards.
Hi @T_Y_Raju
You can use the write range workbook activity to write the datatable in to the excel.
You can use the append range workbook activity to append the data in to the precreated one.
Hope it helps!!
Hi @T_Y_Raju
Use the “Read Range” activity to read the existing data from the Excel sheet and store it in a data table variable.
Use the “Build Data Table” activity to create a new data table variable to store the updated data.
Use the “Add Data Row” activity to add the existing data from the data table variable .
Add the new data to the new data table variable by using the “Add Data Row” activity.
Use the “Write Range” activity to write the updated data table variable to the Excel sheet.
Hope it helps!!
You should do the free training on the UiPath Academy web site. It covers these kind of basic things.