MS Office Excel Read Range

Hi All,
I am using ‘Excel Process Scope’ in my project and getting an error about ‘Excel Read Range’ activity on playing ‘debug’ as-
26.0.181-cloud.21801+Branch.release-s181.Sha.5144f3c3cfd2190f572dba78bd7a3b38929f06b5.5144f3c3cfd2190f572dba78bd7a3b38929f06b5

Source: Write Range Workbook

Message: The process cannot access the file ‘C:\Users\Dell\Documents\7 Robots\Robot4_RealEstateScraping\PropertyListing.xlsx’ because it is being used by another process.

Exception Type: System.IO.IOException

in Main.xaml
at WriteRange “Write Range Workbook”
at Sequence “Do”
at ExcelApplicationCard “Use Excel File”
at Sequence “Do”
at ExcelProcessScopeX “Excel Process Scope”
at Sequence “Do”
at NApplicationCard “Chrome Zillow Real Estate, Apartments, Mortga”
at Sequence “Main”
at Sequence “Main Sequence”
at Main “Main”

System.IO.IOException: The process cannot access the file ‘C:\Users\Dell\Documents\7 Robots\Robot4_RealEstateScraping\PropertyListing.xlsx’ because it is being used by another process.
at UiPath.Excel.Activities.WorkbookActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location —
at UiPath.UIAutomationNext.Activities.NApplicationCard.OnFault(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

I think this is due to non-activation of my MS Office.


Is there any alternate to MS Excel, can I use WPS Office or some other solution?
Thanks

this error isnt caused by office activation. it happens because the excel file is already locked when write range runs - debug mode make this more common since the excel process scope kepps the fike manager. Make sure only one excel scope is using file close any earlier access or switch to webhokk sctivities if you dont need the excel app Wps office wont fix it ui path relies on microsoft excel for excel process scope

you can use wb.close()
excelApp.Quit()

Hi @musmanq
Please kill the excel process for that user before that activity so that it can kill the other instance of excel opened.
and also disable the onedrive/sharepoint sync whenever you are performing the excel actions.

Thanks a lot for your replies.
I am sure excel file is not opened else where.

If you think its a license issue.

Try workbook activities since these work with no excel installed on system also.

Give a try, and confirm if it works…

@musmanq

first issue you are using a workbook read range activity inside an excel process scope…you need to use excel read range…

second thing ideally valid license only would work..but looks like use excel already worked so that must be working..change the workbook read range to excel read range

alternately use workbook read range and you can remove excel process scope and use excel file both

even for write you have separate for workbook and excel

cheers

Use Workbook Activites

@MohammedShabbir
Thanks for your reply.
On using workbook also, getting the same errorl

Hi @musmanq ,

Please check if excel is open somewhere , if yes then try to close and restart the UiPath,
And try to kill excel before reading and I saw inside the excel scope you are using workbook activity that also causing issue just try to using excel activity and if possible please send out the xaml will check and provide u solution
Cheers

1 Like

You don’t need to use excel file only…

Just use read range workbook and write range workbook..
Don’t use anything apart from these two activities. Test and let me know

You are getting error because you are using both…

No need excel process scope and use Excel file..

@MohammedShabbir
Solved by using only ‘Write Range Workbook’ instead of ‘Excel Process Scope’.
Thanks a lot!

1 Like

@nishiijain2000
I have checked opening of Excel from ‘task manager’, that was not opened.
Also, using ‘excel write range’ in ‘excel process scope’ was throwing the same error.
Thanks for your help.

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