"Error opening workbook. Make sure excel is installed" error

How to resolve when an Excel activity is throwing an exception - "Error opening workbook. Make sure Excel is installed"

Complete error message :
“System.Exception: Error opening workbook. Make sure Excel is installed —> System.InvalidCastException: Unable to cast COM object of type ‘Microsoft.Office.Interop.Excel.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Excel._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{000208D5-0000-0000-C000-000000000046}’ failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).”

RemoteException wrapping System.Exception: Error opening workbook. Make sure Excel is installed. —> RemoteException wrapping System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

 

Issue Overview

 

How to resolve when an Excel activity is throwing an exception - "Error opening workbook. Make sure Excel is installed"
 

 

Root Cause

 

This error can be thrown by the Excel Application scope activity or by an Excel activity within the scope. The error might vary depending on whether the Excel Application Scope threw the error or if an Excel Activity within the scope threw the error.

Either way, the error means that either Excel or a library used by Excel is not registered in the system. This can happen if an install is corrupted or if Excel is not installed.

 

 

Diagnosing the issue

 

1.      Open a run command window and run the command “appwiz.cpl”

2.      In the upper right corner search for “Office” or “Excel”

3.      If no application shows up, it means that Excel is not installed or that it was not installed correctly. Go to the section Installing Excel. If Excel does not show up but is installed, contact your admin as they will have to figure out why Excel is installed incorrectly. Also consider contacting Microsoft.

4.      If the application does show up, got to the section Repairing or Reinstalling Excel.

 

Installing Excel

 

1.      Go to the following link and follow Microsoft’s instructions: https://support.office.com/en-us/article/download-and-install-or-reinstall-office-365-or-office-2019-on-a-pc-or-mac-4414eaaf-0478-48be-9c42-23adc4716658

2.      If the link above is no longer valid, just Google “Install Excel”

3.      Alternatively, contact your Admin and let them know that excel is missing.

 

Repairing Excel

 

1.      Before trying to repair, consider uninstalling the app and then installing again. Excel does not take long to install and re-installing accomplishes the same result as repairing but can be easier to do. See Removing Excel.

2.      Go to the following link and follow Microsoft’s instructions: https://support.office.com/en-us/article/repair-an-office-application-7821d4b6-7c1d-4205-aa0e-a6b40c5bb88b

3.      If the link above is no longer valid, just Google “Repair Excel”

 

 

Removing Excel

 

1.      Open a run command window and run the command “appwiz.cpl”

2.      In the upper right corner search for “Office” or “Excel”

3.      Select the Excel or Office application, right click and select “uninstall”

4.      Follow the instructions of the uninstaller.

 

Excel has been closed unexpectedly

Try opening Excel manually, and if you see the following error, Excel has been closed unexpectedly.

Excel couldn't start last time.

Do you want to start in safe mode?


If Kill process activity being utilized to close Excel process, utilize Close Application, instead. In this way, Excel is closed gracefully and would not think that it crashed.