After downgrading from Excel 2013 to 2010 (i.e. removing 2013 and installing 2010) when I try to access the Excel OM from my add-in like this:
if (this.Application.ActiveWorkbook == null)
{
return;
}
I get the following Exception:
Unable to cast COM object of type 'System.__ComObject' 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: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
I have taken the following steps to resolve the issue but none have worked:
- Repaired the office installation
- Uninstalled and reinstalled
- Cleared out all office 15 references from the registry
- Re-registered Excel ("C:\Program Files (x86)\Microsoft Office\Office14\excel.exe" /o)
However, nothing seems to work. Is there something I'm missing or do I actually have to wipe the machine?
EDIT: My guess is that there is still come conflict in the registry but I have no idea where...
Thanks in adv!