Creating a new excel by assigning the data received from the invoice to the variable

“I want to write data read from Excel to a new Excel file, but I’m not sure how to do this. Additionally, I need to keep this Excel file within a folder and ensure it is deleted every evening because multiple Excel files will be read throughout the day, not just one. The data I read from Excel is of the object type, and I need help with how to handle this process effectively. I would appreciate any guidance on writing this data to a new file and managing the deletion of the file daily.”

Hi @Ece_Gulluk

Welcome to the Community.

Which part are you stuck exactly?

If you want to delete that file every evening, then you could do the following:

  1. Store the file names in an excel or txt Tracker file. This can be implemented in the current process.
  2. In a New Process, Read this tracker file and delete the files. Empty/Clear the Tracker file after the deletion. This New Process, can be triggered every evening.

“I am working on a task where I need to create a new Excel file and write variables into it, which I have previously read from another Excel file. These variables are of the ‘object’ data type. I want to make sure that the data is properly organized in specific columns in the new file. Each column will represent different pieces of information, and I need to ensure that the data is transferred accurately while maintaining its structure. What tools, libraries, or methods would you recommend I use to efficiently perform this task?”

  • Read Source Excel File
  • Use Read Range to get data into a DataTable (e.g., dtSource).
  • Process and Extract Required Variables
  • Loop through dtSource using a For Each Row.
  • Extract required columns/values and store them as Object.
  • Prepare Destination DataTable
  • Use Build Data Table to create dtTarget with named columns.
  • Example: Columns: Name (String), Age (Int32), Address (String)
  • Add Rows to Destination Table
  • In the loop, construct each row using extracted Object values, converting them to appropriate types.
  • Use Add Data Row activity to add it to dtTarget.
  • Write to New Excel File
  • Use Write Range to write dtTarget into a new Excel file.

Mark as SOLUTION if you found this as solution

Happy Automation

@Ece_Gulluk

Welcome to the community

first thing you can try is using use excel file and copy paste range activities..if it is excel to excel and no much filtering is involved then this is the best route

cheers