Here you will have to use a combination of uiPath activities.
1)For loop
2)Find First\Last cell activity ( to get the first and last free row in the excel to write the datatable)
3)Write range. Range you will get from step 2
4)Invoke code(you can find the details in the below doc, and you need to merge the cells dynamically)…Cells you will get from step2
Hi @supermanPunch
Thanks for the above solution
Please check the below link:
I have managed to do the coloring and merge headers , just i need to add in the single sheet with highest first with one line space between with formatting and color intact
@supermanPunch I made some changes to the above code and altered it according to the requirement and it worked perfectly fine and code is amazing Thank you for the help!!
@supermanPunch just one more thing after merging and coloring the headers i need to auto fit column width so it looks even , is that possible ? for now i am using vba to autofit the result excel , is there any other way?
@supermanPunch Interop.Excel this dependency from microsoft should only be used ? for this flow to work , is there any dependency from UiPath which will work for this flow
Since any dependency apart from UiPath is restricted to use…
@kavya.s16 , There might be other ways but they are either again from Microsoft or other companies.
I do not think UiPath has a Direct set of activities suitable for this i.e majorly the activities required for Merging the Cells and Colouring the Font as well as Highlighting the Merged Cells.
Currently, if you are using the Modern Design we can find the Format Cells Activity, which can colour the Font and Highlight the cells but Merge cells is not available.
Hence, we either do it using other External packages or VBA/vb.net/c# codes.
Maybe you can suggest a feature request for this purpose Hopefully we should be able to use such features in the near future directly using UiPath.Excel.Activities package.
@supermanPunch sorry for disturbing
but when i installed this Microsoft.office.interop.excel package
I am getting this error from workflow analyzer rule
Error ST-USG-010 Unused Dependencies Dependency package Microsoft.Office.Interop.Excel is not used.
Recommendation
Remove unused packages in order to improve process execution time. Learn more.
@kavya.s16 , You could try Removing the dependency package and check whether it works fine, but mostly the Invoke code Activity would give out a validation error. In this case, you would have to reinstall it again.
@supermanPunch i tried installing and reinstalling i am not getting error in invoke , but from the workflow analyzer rule set stating unused dependency which will not allow to run untill resolved, below link
Error ST-USG-010 Unused Dependencies Dependency package Microsoft.Office.Interop.Excel is not used.
Recommendation
Remove unused packages in order to improve process execution time. Learn more.