"UiPath.Excel.ExcelException: Error opening workbook. If Excel is installed, run the ‘Repair Tool for Microsoft Office Interop’ from the Tools tab on the Home screen. ---> System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied" error while running the process unattended
Issue description:
When running an unattended process with Excel activities the process fails with the error:
"UiPath.Excel.ExcelException: Error opening workbook. If Excel is installed, run the ‘Repair Tool for Microsoft Office Interop’ from the Tools tab on the Home screen. ---> System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. "
Background Process Automation with Unattended Robots are started from via the Robot Service and run in the Windows Session (Session 0). It's important to know that Session 0 has no User Interface and cannot interact with a user session. When running Background Automations via Unattended Robots, using Microsoft Office applications such as Word, Excel or PowerPoint might not work properly as they have been built to run in User-Session, meaning that they need an interactive desktop session and user profile.
Resolution:
Disable the "starts in background" toggle fixed the issue as Excel cannot run in background.
Steps to be followed:
- Open the Studio project
- Project Settings -> General
- Disable the Starts in Background
- Test the project
- Publish to Orchestrator
- Update the process version in the Orchestrator folder
- Retry to run the job
