Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Automation Error (2005)

    I have a VB6 app that calls Microsoft Outlook. It worked fine while using 2003. But now it gives this message: 'Automation Error. The specified module could not be found' error. Here is the code:

    Function SendOutlookMessage(ByVal sSubject As String, _
    ByVal sBody As String, ByVal sSendTo As String, _
    ByVal bShowOnly As Boolean, _
    Optional ByVal sAttachmentFileName As String = "") As Boolean


    Dim objOutlook As Outlook.Application
    Dim objOutlookMsg As Outlook.MailItem
    Dim objOutlookRecip As Outlook.Recipient
    Dim objOutlookAttach As Outlook.Attachment

    ' Create the Outlook session.
    Set objOutlook = New Outlook.Application 'this is where the error is created

    end function

    Any ideas would be great.
    Thanks

    Kim

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automation Error (2005)

    What is the 2005 in the subject of your post? There is no Outlook 2005 as far as I know.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Automation Error (2005)

    Hi there

    Try


    Set objOutlook = CreateObject("Outlook.Application")

    If this doesn't work I have heard that AV software can cause problems with the object creation ( apparently Norton specifically)
    Jerry

  4. #4
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Automation Error (2005)

    Thanks for the replies. Should be Office 2007.

    Tried Set objOutlook = CreateObject("Outlook.Application")

    Error msg 'ActiveX Component cannot create object.

    Disabled AV which is AVG free edition.
    Thanks

    Kim

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automation Error (2005)

    Perhaps You receive run-time error 429 when you automate Office applications helps.

    Other things to try:
    - Run Office Diagnostics - see What happened to Detect and Repair?
    - Select Start | Run..., type <code>regsvr32 Ole32.dll</code> and press Enter.
    - Select Start | Run..., type <code>regsvr32 OleAut32.dll</code> and press Enter.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Automation Error (2005)

    Usually object library references are forward compatible, but I'm sure there must be exceptions. Can you update the References and recompile the app?

  7. #7
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Automation Error (2005)

    Just uninstalled 2007 and installed 2003. The VB app works as intended. My next step is to install 2007, perhaps uninstalling 2003 first. Any ideas as to why 2007 is so obstinate?
    Thanks

    Kim

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Automation Error (2005)

    It would appear from your code that you have set a reference in VB6 to the Outlook object library. Does it help if you remove that reference, declare all your Outlook objects as Object (rather than as Outlook.Application for example) and then try the CreateObject code?
    Regards,
    Rory

    Microsoft MVP - Excel

  9. #9
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Automation Error (2005)

    Thanks to all. Have a lot of info to absorb and apply.
    Thanks

    Kim

  10. #10
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Automation Error (2005)

    Un-installed 2007 and then re-installed it. App works as it should. Many thanks to all for the help. <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Thanks

    Kim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •