How to resolve 0xc0000005 And HRESULT 0x80080005 Office Activities Crash ?
Issue Description: Excel and Outlook activities fails with error code 0xc0000005System.Reflection.TargetInvocationException: An exception occurred at the target of the invocation. --->
System.Runtime.InteropServices.COMException: The COM class generator for the component with CLSID {0006F03A -00-0000-C000-000000000046}
could not be retrieved due to the following error: 80080005 Server execution failed ( Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)
Resolution:
Approach #1 - Set memory clear at the beginning at the flow.
Approach #2 - (Using UiPath)
- Get the process details using Process.GetProcessesByName
- Make the comparison between process owner username and current logged in username and comparing them
- Kill the process for the current user
- Refer the below forum link for more details
Approach #3 - (Using Powershell)
- Use Powershell script to get the user specific process and then delete them.
- Refer the below link for development ideas
- Use Garbage collector to free up the memory.
- Call the Garbage Collector Explicitly. In order to do so, please add the below activities:
The method name in the second activity is "WaitForPendingFinalizers".