Tuesday, January 25, 2011

Error System.InvalidCastException: Unable to cast COM object of type Microsoft.Office.Interop.Outlook.ApplicationClass

Here is a very critical error that comes while working with outlook APIs using C#.Net. The error details is :
System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
   at Microsoft.Office.Interop.Outlook.ApplicationClass.get_Version()
   at ...

This error comes when we remove outlook 2007 from a XP machine and install 2003. Once we installed 2003 on that machine then the above error comes when I tried to add meeting. I have google a lot of things: some answers like ReInstall outlook again and another solution like remove something from the Registry. But I did not get any success by trying the above 2 solutions. Then I remove the outlook 2007 PAI from my system and then it worked for me.

No comments:

Post a Comment