I want to communicate with Excel, so im using the 'Microsoft.Office.Interop.Excel 16.0' DLL. Tho im getting the expection:
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)).'
Im using office 365 but also installed Excel 2013 just to check if this works.
Could anyone tell me why this expection is being thrown and how to fix it?
Thanks in advance
Quick Repair the 'Microsoft Office 365' to get rid of the exception.
Control Panel -> Programs and Features-> Microsoft Office 365 -> Click Change(Right click) -> Select Quick Repair.
User contributions licensed under CC BY-SA 3.0