Excel_automation

Can anyone please guide me how to do the excel automation.
Requirement
1.having one input file, it can contain vegetable names.
2. i want create a excel file with the name of vegetable and write the respective vegetable data in that excel file.

Hi @Abhilash_Yadav ,

can you please share the excel file if possible

i got one excel file from UiPath forum and i have created one example flow, find it below.

This was created very basic level try and let me know if any issues you are observed,
Workbook and DataTable (2).zip (509.8 KB)

1 Like

I will try and let you know.

  • Read the Input Excel File
  • Use Excel Application Scope
  • Inside it, use Read Range to read the full data into a DataTable (dtInput)
  • Get Distinct Vegetable Names
  • Use Assign activity:
distinctVeg = dtInput.DefaultView.ToTable(True, "Vegetable")

This creates a DataTable distinctVeg with only unique vegetable names.

  • Loop Through Each Vegetable
  • Use For Each Row on distinctVeg
  • Inside loop:
    • AssignvegName = row("Vegetable").ToString
    • Use Filter Data Table activity or Linq to filter rows:
dtFiltered = dtInput.Select("Vegetable = '" + vegName + "'").CopyToDataTable()
  • Use Write Range inside another Excel Application Scope
    • File path: "C:\Vegetables\" + vegName + ".xlsx"
    • Write dtFiltered to the new file.