Need to open different instances of excel

Can we open two excel files as different instances and execute macros in both files at the same time from uipath

1 Like

Hey @Athira

Of course yes, just maintain their scope and that’s it !

If you face any challenges please let us know.

Thanks
#nK

@Athira Does the both excel files contains macros in it. In that case use parallel activitywithin this take two excel scopes parallelly, each excel scope pointing to different excel file and execute the macros in the related excel scopes

Capture

I have already tried that, it doesn’t open excel as a new instance and doesn’t work as per my requirement.

Just using two different excel application scope doesn’t work as per my requirement.

1 Like

Hey @Athira

Could you please show us what error or how you did you do it?

Also I hope you don’t have the two Excel files with same name ?

Thanks
#nK

Hello @Athira ,

In the modern activities you can try to use Use Excel File activity and open the Excel which you want to use. So to open 2 excels you can use these activity twice and run the macros.

So it will work as a container to action all excel activities for that particular excel.

There is no error, when we use two excel application scope and execute in parallel using parallel activity, it just execute them as multiple threads under same instance. Ofcourse i can execute the macro in two excels using parallel activity, but thats not what i want, i need both excels to be different instances. Same as when we manually open new instance of excel

1 Like

Hey @Athira

What ever I have suggested is without parallel !

Thanks
#nK

Sorry i don’t think i understood you, can you please explain how should i execute both the macros at the same time using different Excel instances?

1 Like

Hey @Athira

Okay you wanna execute at the same time ?

So what is the business case for this & how are you currently doing manually please ?

Thanks
#nK

Yes i want to execute at the same time. So there was a business case where the sme s had to do a smartview refresh on some reports. Each report refresh used to take more than hour. Its simple step just hit the smartview refresh button…there is nothing else we need to do…but the problem was they have a downtime every 15 - 20 mins in which they cannot do the refresh. They were doing the refresh by splitting the file. So it was a very time consuming task. I was able to make some alterations in excel using macro and now this whole refresh take only 8 mins for a file. So that means around 16 mins altogether. If i manually open one file and execute that macro and then open the second file as a new excel instance ( 7 Ways to Open Multiple Instances of Excel - BI Gorilla) and execute macro, the whole refresh thing gets completed in 8 mins.
Was trying to achieve the same using uipath. We have some vba scripts that can be used for the same, somehow didn’t work at the first time i tried, due to some technical issues i wasn’t able to try that again. So was just seeking help from forum in the mean time

Hi @Athira ,

Could you show us the Current Workflow Screenshots where you are trying to open Different Excel Instance using Parallel Activity ?

Sorry have some technical issues now, so cannot share the screenshot. I was just trying inside parallel activity, open excel application scope for each and execute macro in each file. Also tried to do open excel using start process and execute macro

@Athira ,

Are the Macros to be executed for Both the Excel Sheet’s the same or does it differ ? Do they have different sheetnames which you are passing to the Invoke VBA Activity ?

If the Macro is the same for both Excel , maybe we can also Try with the Parallel For Each Activity.

By Providing the filenames as the list to Iterate and use each item from the list as the Filename in the Excel Application Scope.

Both the Parallel Activity and Parallel For Each Activity are somewhat the same, but we could give it a try on this method to check if it works if not already tried.

Hi Athira, I have the same usecase of smartview refresh…can you pls let me know how have you handled this i.e opening multiple excel instances and running macro at same time.