Error Opening Workbook. Make Sure Excel Is Installed - KB

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

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


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)).

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.

Investigation Steps:

  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 to Download and Install or Reinstall Microsoft 365 or Office 21 on a PC or MAC
  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 to Repair an Office Application .

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 errors;

  • Excel has been closed unexpectedly.
  • Excel couldn't start last time.
  • Do you want to start in safe mode?

image.png


Solution Approach: If Kill process activity is being utilized to close Excel process, utilize Close Application, instead. In this way, Excel is closed gracefully and shall not crash.