Has anyone done a scene like this, please?
Consolidation can be done using VBA
Thereās an alternative way too.
https://www.codeproject.com/Tips/5264786/Merge-Many-Excel-Files-into-one-VBS
Thank youļ¼bro. But ,Iām not familiar with VBAļ¼how do I put these VBA code into the UiPath Activityļ¼
Could you please show me how to do itļ¼
Hi
First Loop to all your Excel Sheets and then Inside Loop read each excel sheet data and store it in a DataTable (datatable1)
Write an If Condition that your Maindt.Rows.Count>0 then Use Merge Data Table activity and Pass Source as datatable1 and Destination as Maindt. else Store datatable1 all the data inside Maindt by using Assign Activity (Maindt=datatable1)
Thank youļ¼Bro. Do you have more detailed instructions on how to do this? Actually , every excel file have only one sheet. I know how to loop the files , but donāt know how to merge each DataTable from each excel fileā¦
Hi
Please find the attached screenshot of the solution
Here first we have a loop to our Excel Doc and then read one by one each excel first sheet data and on the basis of Condition we have merged our data in the main data table
Happy Automation
it is too hard for me . Can you show me a Demo.
Hi
Please find the below working Demo
TestExcel_Demo.zip (14.6 KB)
Cheers
@491979546
Thank you so so muchćć
Your demo can achieve the effect I want, but I follow your demo and it says maindt is empty and reports an error.
Hi @491979546
Please use the Updated one I have attached after a few modifications and make sure you have initialized the maindt with New DataTable() in variable panel , if you are still facing the issued share the error screenshot
Thanks
Hi @491979546
This error has occurred because you havenāt initialized the mainDT variable with New DataTable as Default.
See the below-attached screenshot
Cheers
Great, thank you so much, Iām a newbie , so I aways make mistakesā¦is new DataTableļ¼ļ¼a method which means create a empty DTļ¼
Hi @491979546
No Issue we are happy to help
Exactly it means that you are initializing the DataTable with Empty DataTable before going to use it.
Thanks
Thank you ļ¼you are great UiPath masterļ¼
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.