Answered 0x80029C4A (TYPE_E_CANTLOADLIBRARY)

  • Wednesday, June 27, 2007 5:17 AM
     
     
    hi all,

    We are developing a com addin for outlook 2002 using c#.

    for all our customers it is working fine except for one.
    in his machine he is getting the following error.

    Unable to cast COM object of type 'System.__ComObject' 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))


    we are not able to make out what exactly the problem is.

    can any one please help.

All Replies

  • Wednesday, June 27, 2007 10:33 PM
    Answerer
     
     Answered

    Hi,

     

    Sounds like you have a problem with your typelib registration.  Presumably, the Com interop layer is hitting the registry to try to locate the typelib.  It would start by looking under HKCR\Interface\{00063001-0000-0000-C000-000000000046}\Typelib.  The default value should refer to the guid for the typelib that defines the interface in question: which should be located under the following key: HKCR\Typelib\{00062FFF-0000-0000-C000-000000000046}.  There should be a version subkey and then a 0 subkey, and a win32 subkey under that.  The default value of the win32 key should point to the typelib (which is msoutl.olb). 

     

    I'd start by checking your Office directory for msoutl.olb.  If it is there, try running 'regtlib msoutl.olb'.  You should have regtlib on your machine is part of your Visual Studio install, I believe.  Anyway, reregistering the typelib will rewrite all of the necessary keys to the registry.  You will need administrative privileges for this operation. 

     

    The other possibility is that msoutl.olb itself is corrupt, in which case reinstalling Outlook should fix the problem.

     

    Sincerely,

     

    Geoff Darst

    Microsoft VSTO Team

  • Friday, July 20, 2007 4:13 PM
     
     

    I am getting the same error

     

    Could not access Outlook on this computer (Create Object Failed) - Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type '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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

    I tried running the regtlib command as you suggested, and got a response indicating that it was successful; however the problem remains <even after a reboot>.

     

    Any other suggestions short of reinstalling Outlook <Outlook appears to be running fine notwithstanding this problem with my visual studio program>

     

    Thanks, Rob

    July 20th, 2007

     

     

     

     

  • Wednesday, July 25, 2007 5:58 PM
     
     

     

    I was able to resolve this myself by running a program that came with Outlook - C:\Program Files\Common Files\System\MSMAPI\1033\Scanpst.exe

     

    for more information please see this site:

     

    http://www.emailaddressmanager.com/outlook/repair.html

     

    Rob

    www.callclerk.com

    www.arulerforwindows.com

    July 25th, 2007

     

     

  • Wednesday, August 08, 2007 12:07 PM
     
     
    Hello Sir,
             I am trying to sync Outlook 2000 contacts with Vista using C#. But while opening a session in Outlook 2000 with the following statement of code

     ns = app.GetNamespace("MAPI");

    I am getting a COM exception which is as follows:

    Unable to cast COM object of type 'Outlook.ApplicationClass' to interface type '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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

    I am unable to read Outlook Contacts and the application gets crashed. I ran Outlook Inbox Repair Tool and repaired the Outlook.pst file. I also copied the wab32.dll and wab32res.dll into

    C:\Windows\System32 folder, but still I am getting the crash. Can you please guide me in this regard? Thanks a lot in advance.


    Thanks and Regards
    Amogh G.R.
  • Sunday, September 23, 2007 7:47 AM
     
     

    Hi,

     

    I am also getting the CANTLOADLIBRARAY Exception and i have tried everything written in this post but still no help.

     

    Any workaround ?

     

    Thanks

    Kulvinder Singh

     

  • Wednesday, January 09, 2008 10:53 AM
     
     Proposed

    Hi,

     

    Mine application was running properly in Windows xp,

    I did following operations,

     

    I changed my development environment to the new system running on Windows vista.

     

    Initially it contains office trial version of 2007 It started posing the problem,I thought of problem with 2007 dll's I did unintall office 2007 and installed office 2003. I am getting the same problem as mentioned above posts. To my surprise I deployed the application in one of the client system which is running on vista , It is running normal as other XP systems.

     

    Why my development environment is seeing the above problem..Help me out. Thanks in advance..

     

    Shirish

     

    • Proposed As Answer by Shiv Khare Friday, January 30, 2009 10:48 PM
    •  
  • Wednesday, April 07, 2010 5:26 PM
     
     Proposed Has Code

    Removing an Office version and installing an older one, is probably what caused it. The newer version may have left some junk in the registry.
    I had the same case, and this is how got over:

    Notice the registry keys mentioned eariler:

    HKCR\Typelib\{00062FFF-0000-0000-C000-000000000046}.  There should be a version subkey 

    If there is more than one version sub key (which is possible if you removed a newer version of Outlook) you should remove the one that refers to the version not installed:

    (check the \0\win32 subkey to see the expected location of the typelib. If it points to a removed version, remove the whole version subkey).

    As always use caution changing the registry, and export the keys before removing them.

    • Proposed As Answer by OK_10 Wednesday, April 07, 2010 5:28 PM
    •  
  • Friday, May 28, 2010 7:20 PM
     
     Proposed

    Hi I recently had the same problem and after trying all of the solutions i found on the net, it appears that setting the project to compile x86 code completely solves the issue.

    I hope this helps some of you out there, because this is a really annoying problem

     

     

    Greetings

     

    Johan

    • Proposed As Answer by Erick007 Thursday, November 04, 2010 11:54 PM
    •  
  • Friday, November 05, 2010 12:05 AM
     
     

     

    Hey Johan, I just did what you proposed and it worked perfectly fine for me compiling my app in Visual Studio 2008 running on Win7. Thanks a lot.

     

    Cheers,

    -Erick

  • Monday, November 29, 2010 4:25 PM
     
     

    Hi,

    Changing to x86 also solves the problem in my app.

    But I don't think it is a solution, because my application should be able to be run under any CPU and therefore compiled with "Any CPU" settings.

    If anyone has an idea on how this can be solved it would be appreciated :)

    JokesP: Thank you for the tip as I'm now able to focus on some other stuff

     

    Regards, Nicklas

  • Friday, February 18, 2011 6:09 PM
     
     
    Thanks OK_10. Worked a treat for me. In my case the removed later version did not have the \0\win32 subkey but I deleted the whole version subkey anyway.
  • Tuesday, September 27, 2011 5:53 PM
     
     

    Hi all,

     

    setting it to x86 solved it for me too. Thanks for this!

     

    greets,

    g