Hello,
I was trying to implement an example with Excel triggers. However, every time Excel file is modified and saved UIPath throws an exception:
Monitor_Excel has thrown an exception
Message: The process cannot access the file ‘[local path]\invoice-template.xlsx’ because it is being used by another process.
Source: Read total value
Exception Type: IOException
System.IO.IOException: The process cannot access the file ‘[local path]\invoice-template.xlsx’ because it is being used by another process.
at UiPath.Core.Activities.MonitorEvents.BodyFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
the attached workflow has 2 validation errors, some lost space characters in two activities.
you will notice them when validating using the Studio`s option. If you fix those, the workflow will run just fine.
make sure you have excel package installed.
Thank you for the reply, but this didn’t help. The file still can’t be accessed:
Monitor_Excel has thrown an exception
Message: The process cannot access the file ‘C:\Users\user\Documents\UiPath\File change\invoice-template.xlsx’ because it is being used by another process.
Source: Private: Read total value
Exception Type: IOException
System.IO.IOException: The process cannot access the file ‘C:\Users\user\Documents\UiPath\File change\invoice-template.xlsx’ because it is being used by another process.
at UiPath.Core.Activities.MonitorEvents.BodyFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
first of all I guess you need to redefine the process because you are trying to get information from an excel template while it’s being process…(obviiously the reason for the error XD)
So, I see two approcheas here, one is to save the workbook and continue or to ask the user to close it. Like I said you need to define your automation in the way that will achieve what your customer wants to achieve.
For the ones intriguing about System.GC this and this article might be helpful
I have kept a while loop where the robot keeps checking until the error has vanished ( you can send alert here) and in finally used GC method which I assume should work for him.