Dears,
How To Merge Many Excel Sheet in One Sheet Using UiPath?
Knowing that , the Number of Sheet might Increase or Decrease, So Probably Need For Each Loop to Read first Existing Sheets in Workbook than Merge them all to one sheet.
Thanks in Advance
Hi @hsendel
there is a Package from Balareva
Hello Friends,
I have successfully uploaded the BalaReva XL Activities in UiPath Go.
This package contains 36 custom activities. It is related to the Workbook, worksheet and sheet data. It helps and simplifies more processes into the excel file. All components can be configured very user friendly.
https://go.uipath.com/component/balareva-xl-activities
This package is having the below activities.
Pie Chart - Using these activities you can able to generate the Pie Chart
Column Chart - Using…
there you can use “get sheet name” and take a loop.
2 Likes
Thanks @MarioHerrmann , Could you please share small example for how to achieve this? Because there is no Merge Sheets
My approach would be like this (first quick idea)
Count how many spreadsheets there are
Then read sheet 1 and save it in a DT
Then read sheet 2 and append to DT
Then read sheet n …
Create new spreadsheet
Write the DT to the new spreadsheet with WriteRange
Like I said is just a quick-and-dirty idea. There are certainly a lot of subtleties that need to be considered to make the process robust.
There are certainly people here in the community who can solve this much more efficiently with VB code.
1 Like
There is no count Sheet activity in BalaReva Package
@hsendel - Please try like this…
Read Excel application scope → In “Output” Workbook declare a workbook variable called wb
For Each → Type Argument is “String”
Read Range(Excel not workbook) → give the the sheet Name as "EachSheet " and stored it to datatable called dt
Add If Loop if file.exists(“Output.xlsx”)
Then → Append Range → “Output.xlsx” → SheetName = Eachsheet → dt
Else → Write Range → “Output.xlsx” → SheetName = Eachsheet → dt
Hope this helps…
1 Like
Thanks @prasath17 , Seems there is something missing in step4 I got the following :
@hsendel - Apologize…it should not be Eachsheet…As shown below…
Complete Workflow…
So first time when the loop runs, file output.xlsx wont exist so it will go to write range and creates the file…and from the 2nd run onwards it goes to append range…
Note: In the write range, please check “Add Header”. Also instead of wb.getsheets you can use “Get workbooksheets” activity which will give you all the sheetnames and then you can use the sheetnames in the for each(which is exactly similar you don’t have to remember the code)
2 Likes
Thanks a lot @prasath17 , Very easy and Simple
1 Like
system
(system)
Closed
July 16, 2021, 1:46pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.