Excel Application Scope for each Invoice sheet: Failed opening the Excel file

I’m currently taking a course in UiPath Academy, it is ‘Build Your First Process with Studio’ from RPA Developer Foundation Learning Path. And I’m still on the section ‘Build the Workflow - Part 2’. From this course, I have to build a robot that can save 4 outlook attachments (.xlsx) to a specified folder and then use the Excel Application Scope in the For Each activity to get a client code from the xlsx file. But when the robot executes the Excel Application Scope, I got an error like this:

“Excel Application Scope for each Invoice sheet: Failed opening the Excel file file-location\Invoices\Invoice 4.xlsx. Possible reasons: the file is corrupt, the file is already used by another process or you don’t have permissions to open the file.”

I have made it clear that the file doesn’t open when the robot runs and neither corrupt. Anyone can help?

@tsabita please try kill process activity for Excel before excel application scope
It will kill all another excel processes if another is using it.

Hello @tsabita

Try to add some delay before to the Excel application scope and use kill process as a prerequisite to close all the excel files as a first step of execution.

Thanks

Hi @tsabita

Welcome to uipath community

Try to use Kill Process activity and Delay activity before the excel application scope

In the Excel application scope → try to pass the File path of the excel file

I Assuming that the excel file is in Project location

Environment.CurrentDirector+"\Invoices\"+RetrievedEmail.Attachments.FirstName

Regards
Gokul

it’s still doesnt work :frowning:

hello, i’ve tried the kill process and added a delay but it didn’t work out :frowning:

hi @Gokul001 , thank you in advance, i’ve tried your solution but it still has the same error

Can you share the error screenshot @tsabita

Regards
Gokul

Hello @tsabita

Did you checkedin taskmanager and are you able to see the excel process running? Also try to update the excel packages.

Thanks

Yes, I have checked the task manager and even in the Details tab I couldnt find the Excel task. My Excel package is also the latest version. So I tried to uninstall the Excel package, then install it again, and it works now :sweat_smile: Thank you!

1 Like

Thank you @Gokul001 , it solved :smiling_face:

Good to hear that.

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.