none
VB 2010 application crashes while attaching an email if Outlook 2010 is opened RRS feed

  • Question

  • A functionality in the application attaches a report file to the Outlook email on a button click. This functionality works absolutely fine on WinXp but throws an exception on Win7 with Outlook 2010 (if outlook is already opened). If outlook is closed when user executes this functionality, the application successfully opens the outlook with new email attached with the report file.
    I receive the following exception:

    System Error Message: Retrieving the COM class factory for component with CLSID{.........} failed due to the following error:80080005

    Could someone please help as I am novice in .net?

    thanks

    Swapnil



    Wednesday, March 21, 2012 10:22 AM

Answers

  • Check the manifest file for the application and see what user level is requested. Whether or not the user has admin permissions doesn't matter, it's the permissions that are requested for specific applications that matter.
     
    For example, here's part of the manifest file where "asInvoker" permissions are requested:
     
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel
                level="asInvoker"
                uiAccess="false" />
          </requestedPrivileges>
        </security>
      </trustInfo>
     
    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "SwapnilSJadhav" <=?utf-8?B?U3dhcG5pbFNKYWRoYXY=?=> wrote in message news:d141bc8c-ac91-4595-bac6-d48d768fcc40...

    HI Damian,

    Thanks for replying back and apologize for not replying back to you at the earliest as I was on vacation. 
    I am not sure how to check the user security contexts but will check with my senior team members. Will the functionality work if the user who runs this app has an administrative privilege on his machine? I tried that but I received the same error. I am not sure if that's the right way to check the security context.

    Appreciate all your help.

    thanks,

    Swapnil



    Swapnil


    Ken Slovak MVP - Outlook
    Wednesday, March 28, 2012 2:14 PM
    Moderator

All replies

  • Probably different UAC levels - make sure that both your app and office are run in the same user security contexts (is one of them requesting higher priviligies either manually or in manifest file?)
    Wednesday, March 21, 2012 12:03 PM
  • Hi Swapnil,

    Thanks for posting in the MSDN Forum.

    Did you try DamianD's suggestion?

    @DamianD,

    Thanks for great work.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, March 23, 2012 5:46 AM
    Moderator
  • HI Damian,

    Thanks for replying back and apologize for not replying back to you at the earliest as I was on vacation. 
    I am not sure how to check the user security contexts but will check with my senior team members. Will the functionality work if the user who runs this app has an administrative privilege on his machine? I tried that but I received the same error. I am not sure if that's the right way to check the security context.

    Appreciate all your help.

    thanks,

    Swapnil



    Swapnil

    Wednesday, March 28, 2012 7:26 AM
  • both apps must run in the same security context - either as elevated or as normal users.
    Wednesday, March 28, 2012 7:55 AM
  • Check the manifest file for the application and see what user level is requested. Whether or not the user has admin permissions doesn't matter, it's the permissions that are requested for specific applications that matter.
     
    For example, here's part of the manifest file where "asInvoker" permissions are requested:
     
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel
                level="asInvoker"
                uiAccess="false" />
          </requestedPrivileges>
        </security>
      </trustInfo>
     
    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "SwapnilSJadhav" <=?utf-8?B?U3dhcG5pbFNKYWRoYXY=?=> wrote in message news:d141bc8c-ac91-4595-bac6-d48d768fcc40...

    HI Damian,

    Thanks for replying back and apologize for not replying back to you at the earliest as I was on vacation. 
    I am not sure how to check the user security contexts but will check with my senior team members. Will the functionality work if the user who runs this app has an administrative privilege on his machine? I tried that but I received the same error. I am not sure if that's the right way to check the security context.

    Appreciate all your help.

    thanks,

    Swapnil



    Swapnil


    Ken Slovak MVP - Outlook
    Wednesday, March 28, 2012 2:14 PM
    Moderator
  • Thank you all!  I will work on this and will let you know in case I have any queries.

    thanks again!

    Swapnil


    Swapnil

    Friday, March 30, 2012 5:51 AM