Results 1 to 8 of 8

Thread: ActiveX Error Unable to create ActiveX object

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    14

    ActiveX Error Unable to create ActiveX object

    Dim ol as Object
    Dim olns as Object
    Dim objFolder as Object
    Dim objAllContacts as Object
    Dim Contact as Object

    Set ol = New Outlook.Application------**Error occurs here**
    Set olns = ol.GetNamespace("MAPI")
    Set objFolder = olns.GetDefaultFolder(olFolderContacts)
    Set objAllContacts = objFolder.Items

    For Each Contact In objAllContacts
    MsgBox Contact.FullName

    Next Contact
    End Sub

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Does the computer you are running that code on have Outlook installed? Is it the same version that you referenced?

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    14

    ActiveX help

    Edneeis: I version of outlook running on the computer that I want
    to execute the program on is Outlook Express.
    Is the Reference to Microsoft Outlook 9.0 Object Library the
    correct one. I have also tried to allow ActiveX through IE5 security settings.---Also doesn't work

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I am pretty sure that 'Microsoft Outlook 9.0 Object Library' references the Outlook from Office 2000 not Outlook Express. I'm not even sure there is an ActiveX component for Outlook Express although you'd think there would be. There probably is but I don't know what it is.

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    14

    ActiveX Help

    Well thanks anyway. I'll keep looking.

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    14

    I could be mistaken

    I ran across a Microsoft support article that said that Outlook Express didn't have an Object Library and that only simple MAPI objects could work with it.
    I could be mistaken but my code probably only works with Outlook
    but I would be happy if someone found a way for my code to work with Outlook Express.
    Thanks.

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Search this Forum for MAPI and I bet you'll find some good info.

  8. #8
    swb76
    Guest
    my guess is you haven't referenced the DLL correctly.
    try this code and see if it works

    dim obj as outlook.application
    set obj = new outlook.application..

    i guess i can be of this much help..good luck!!

Posting Permissions

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



Click Here to Expand Forum to Full Width