Loop through the excels inside a folder to open up and unmerge the first cell (A1) to save

Loop through the excels inside a folder to open up and unmerge the first cell (A1) to save.

Use Case Description

Hi Experts,

I need a way to loop through the excels inside a folder (I have a master excel file to control the filename, sheetname if needed) to open up each excel and unmerge the first cell (A1) to save. I have almost 6000 excel in the folder.

AS-IS WORKFLOW, TO-BE WORKFLOW

-

Other information about the use case

Industry categories for this use case: Other Sector

Skill level required: Beginners

UiPath Products that were used: UiPath StudioX

Other applications that were used: Excel

Other resources: -

What is the top ROI driver for this use case?: Accelerate growth and operational efficiency

@Huang_Yew_Wai_Barry

You can loop through excels ans use invoke vba with below code

Sub UnMerge()

ActiveSheet.Range("A1").UnMerge

End Sub

Also if the file and sheet locations are in excel…we can directly do the open and close also from excel itself using macros and that can be invoked from UiPath

Hope this helps

cheers

Thanks Anil for the quick reply. Sorry for the noob follow-up question. how can include a macro code into the StudioX?

@Huang_Yew_Wai_Barry

Save the above code as a .vba file or a text file and use invoke vba inside the use excel activity

Hope this helps

cheers

Thank you!

1 Like