locked
Retrieving the COM class factory for component - Outlook

    Question

  • I have Outlook Professional 2007 installed on my dev machine.  Everytime I try to instantiate an outlook.application I get the errror: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.  I've looked in the Dcom, but there is no hint of this class id.  I've repaired, uninstalled and reinstalled and yet the same results.

    All I'm really trying to do is to get a window to return selected recipients to my code.  I'd prefer to use 100% mapi, but I can't find anything like an inspector.  So, the questions are:  (1) Is there an easier approach to getting a recipient list out of mapi, (2) any ideas how to resolve the class error?

    Thanks,
    Greg
    Greg Kowieski The World On-Line
    Tuesday, July 21, 2009 5:38 PM

Answers

  • Hi Greg,

    Yes, I saw discussion about some anti-virus software may prevent Outlook automation. So could you please stop OneCare and try again to see if it works.

    And what is your OS version? And could you please post your codes? When your codes are executed, is there any Outlook instance already executing?(We can observe this using task manager). I saw some discussion that in Vista with UAC turned on, if the Outlook is already run with administrator priviledge, normal level application cannot do Outlook automation unless we start it by right clicking and choosing Run as administrator.


    Regards,
    Ji Zhou

    • Marked as answer by Greg Kowieski Monday, July 27, 2009 6:23 AM
    Wednesday, July 22, 2009 8:55 AM
    Moderator

All replies

  • Run regedit, and open the key HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}
    The InprocServer32 key should not have a Default value there, but if it does...that's the problem.

    That error is easily translated using WinError.h as a guide. The error is a WARNING, from facility WINDOWS, and the warning is "Access denied." (You have a [Symantec] script blocking mechanism in place, apparently.)

    Tuesday, July 21, 2009 6:53 PM
  • I removed the key that should not have been there.  Now the error is Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154.  Where is the winError.h located by default?

    Thanks
    Greg Kowieski The World On-Line
    Tuesday, July 21, 2009 6:59 PM
  • That one is class not registered...and is directly out of WinError.h. (The ones with low numbers are not listed like that...they are at the beginning. All I did on this one was search for 0154, and it found 80040154. (Facility 4 is FACILITY_ITF.)

    WinError.h is installed with the Windows SDK. On my system that is at :

    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\WinError.h

    There is a function in the Win32 API...FormatMessage, which can be used to create a human-readable version of the error message. I don't have a prototype for that on this system, but I believe I do at home.

    I think that you might have to uninstall the Symantec component that is being referenced by that.
    Tuesday, July 21, 2009 7:13 PM
  • I don't run symantic....  weird huh?  Maybe its one care?  Thanks for your help though.


    Greg Kowieski The World On-Line
    Tuesday, July 21, 2009 7:14 PM
  • No problem. You know, it might have been left over from a trial of Norton Anti-Virus, or something similar. I Googled the error message, and there were a lot of hits, but I can't research it right now. One Care might also be the culprit. My work machine uses NOD, and I don't use Outlook much...I did not have that Default key on my machine, but I do have the Outlook component available. (Maybe I'll try it later at home, and we can get this figured out.)

    Weird...oh yeah, its weird alright.

    Cheers.
    Tuesday, July 21, 2009 7:34 PM
  • Hi Greg,

    Yes, I saw discussion about some anti-virus software may prevent Outlook automation. So could you please stop OneCare and try again to see if it works.

    And what is your OS version? And could you please post your codes? When your codes are executed, is there any Outlook instance already executing?(We can observe this using task manager). I saw some discussion that in Vista with UAC turned on, if the Outlook is already run with administrator priviledge, normal level application cannot do Outlook automation unless we start it by right clicking and choosing Run as administrator.


    Regards,
    Ji Zhou

    • Marked as answer by Greg Kowieski Monday, July 27, 2009 6:23 AM
    Wednesday, July 22, 2009 8:55 AM
    Moderator
  • Sorry, had to take a vacation before the hair pulling event started.  This error is killing me! :-)

    Before I read your post, I repaired, rebooted and tried everything else.  Then I uninstalled Office Enterprise 2007 completely and re-installed, (rebooting between each).  After that I get the first error: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.

    I'm running Vista Business.  I have an instance of outlook running from normal start programs.  My code is incredibly straight forward:

    friend sub SendMailOut()
      Dim _outlk As New Outlook.Application
    end sub

    That's it!  Nothing more, the dim is what is failing.

    Here is the really weird thing:  I also program in a language called Dexterity.  Dex allows you to make com references very similar to VS.  Even while everything fails in vs2008, dex is still able to operate the outlook com library via this reference:  {00062FFF-0000-0000-C000-000000000046} ; C:\Program Files\Microsoft Office\Office10\msoutl.olb.  Which I believe is the old reference for 2003.

    I've tried to regsvr32, but apparentenly I have the wrong dll to try to register, (getting the entry point error).

    I've tried turning One Care off as well.  Same results.  I do have the UAC on, so that's my next step.  I'll update after I know those results shortly.

    Thanks for helping!


    Greg Kowieski The World On-Line
    Monday, July 27, 2009 5:48 AM
  • Ok, turns out it's the UAC.  Ji.Zhou, you are my hero!  I've been researching and trying everything under the sun.  Never thought to look at the UAC.  I've always started VS2008 in Administrative mode, so I thought for sure the UAC wouldn't be an issue.

    So, now that we know its the UAC, any suggestion on how to have the UAC on and still be able to use the interop?

    Btw, the post came in backwards... This post was my last step that worked.
    Greg Kowieski The World On-Line
    • Edited by Greg Kowieski Monday, July 27, 2009 6:29 AM because I wanted to...
    Monday, July 27, 2009 6:23 AM
  • Hi Greg,

    Based on my test, the story is when automating Office 2007 application from another application. They must be executed in the same privilege level. That is to say, if there is already an Outlook running on the system in normal mode, the application we used to automate it should be in normal mode. If the Outlook is in Administrative mode, the application we used to automate it should also be in administrative mode.

    The issue is your Outlook running as normal state and the Visual Studio is running as Administrative state.


    Regards,
    Colbert
    • Proposed as answer by Kultman Wednesday, October 07, 2009 12:19 PM
    Tuesday, July 28, 2009 7:40 AM
    Moderator
  • Thank you!! That was it - was about to throw my pc out the window :)
    Wednesday, October 07, 2009 12:19 PM
  • sweet...
    "The issue is your Outlook running as normal state and the Visual Studio is running as Administrative state..."

    That sound pretty cool, but , step by step in the practice how do you balance the state of those processes?, can you post or send a link of how to do that? ( Normal mode? Admin mode? you know ... as a little guide for dummies ) 

    I'm actually having this problem... i'm kinda noob at this and  i didn't figure out how to develop this solution now that i know that it has a solution =)  =P

    tks!!
    Tuesday, October 27, 2009 11:39 PM
  • Step 1)  I turned off the UAC.
    Step 2)  I always fire up VS in Admin mode, (right click on the icon you use to fire up VS and locate the advanced button.  Mark, the run as administrator check box).

    That's all I had to do.  Hope that helps.
    Greg Kowieski The World On-Line
    Wednesday, October 28, 2009 5:05 AM
  • Thanks for the blog. It worked for me.

    Friday, November 11, 2011 2:12 PM
  • Thanks,

    Blog worked for me too.

    :):)

    Friday, June 08, 2012 6:24 AM