msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with Outlook Automation

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation
Author Message
Neil



Joined: 04 Oct 2007
Posts: 11

PostPosted: Mon Jan 01, 2007 4:24 am    Post subject: Problem with Outlook Automation Reply with quote

I have some code I use to create a mail message in Outlook 2003 as follows:

Dim objOutlook As Outlook.Application
Set objOutlook = CreateObject("Outlook.Application")
etc....

The code works fine everywhere except on one computer. On that computer, the
user gets Error -2147024770: "Automation error. The specified module could
not be found."

I did some searching online, and I found that most of the time when people
got that message, it was because a DLL wasn't registered. So I looked up the
reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library," and
it referred to msoutl.olb. However, that OLB file can't be registered,
because it's not an OCX or DLL.

So, any thoughts about what needs to be done here?

Thanks!

Neil

Archived from group: microsoft>public>office>developer>automation
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 04 Oct 2007
Posts: 15

PostPosted: Sun Dec 31, 2006 11:41 pm    Post subject: Re: Problem with Outlook Automation Reply with quote

Try running Help | Detect and Repair in Outlook. It might also be worth knowing whether you can run any Outlook automation code in Outlook's own VBA environment.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $yx6.1170@newsread2.news.pas.earthlink.net...
>I have some code I use to create a mail message in Outlook 2003 as follows:
>
> Dim objOutlook As Outlook.Application
> Set objOutlook = CreateObject("Outlook.Application")
> etc....
>
> The code works fine everywhere except on one computer. On that computer, the
> user gets Error -2147024770: "Automation error. The specified module could
> not be found."
>
> I did some searching online, and I found that most of the time when people
> got that message, it was because a DLL wasn't registered. So I looked up the
> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library," and
> it referred to msoutl.olb. However, that OLB file can't be registered,
> because it's not an OCX or DLL.
>
> So, any thoughts about what needs to be done here?
>
> Thanks!
>
> Neil
>
>
Back to top
View user's profile Send private message
Neil



Joined: 04 Oct 2007
Posts: 11

PostPosted: Tue Jan 02, 2007 7:53 am    Post subject: Re: Problem with Outlook Automation Reply with quote

Tried Detect and Repair. Didn't find anything.

I don't think there's anything wrong with the DLL; I just think it's not
registered. Unfortunately, I don't know which DLL it is. The file referenced
in Tools | References is msoutl.olb, which, if I understand correctly, is
just a library referencing other files? So I'm not sure which DLL or OCX is
causing the problem here, or else I'd just try Regsvr32 and try and get it
registered.

Neil


"Sue Mosher [MVP-Outlook]" wrote in message @TK2MSFTNGP06.phx.gbl...
Try running Help | Detect and Repair in Outlook. It might also be worth
knowing whether you can run any Outlook automation code in Outlook's own VBA
environment.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $yx6.1170@newsread2.news.pas.earthlink.net...
>I have some code I use to create a mail message in Outlook 2003 as follows:
>
> Dim objOutlook As Outlook.Application
> Set objOutlook = CreateObject("Outlook.Application")
> etc....
>
> The code works fine everywhere except on one computer. On that computer,
> the
> user gets Error -2147024770: "Automation error. The specified module could
> not be found."
>
> I did some searching online, and I found that most of the time when people
> got that message, it was because a DLL wasn't registered. So I looked up
> the
> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library," and
> it referred to msoutl.olb. However, that OLB file can't be registered,
> because it's not an OCX or DLL.
>
> So, any thoughts about what needs to be done here?
>
> Thanks!
>
> Neil
>
>
Back to top
View user's profile Send private message
RobinS



Joined: 04 Oct 2007
Posts: 13

PostPosted: Tue Jan 02, 2007 12:12 am    Post subject: Re: Problem with Outlook Automation Reply with quote

I assume the user has Outlook installed? You could try reinstalling it
if possible and see if it's a problem with the installation.

Otherwise, you have to figure out which call is causing the problem,
and the only way to do that is to put a bunch of msgbox statements
in your code and run it on his computer. Maybe it's not the Outlook
calls causing your problem.

Robin S.
--------------------------------------------
"Neil" wrote in message $pQ3.2889@newsread4.news.pas.earthlink.net...
> Tried Detect and Repair. Didn't find anything.
>
> I don't think there's anything wrong with the DLL; I just think it's
> not registered. Unfortunately, I don't know which DLL it is. The file
> referenced in Tools | References is msoutl.olb, which, if I understand
> correctly, is just a library referencing other files? So I'm not sure
> which DLL or OCX is causing the problem here, or else I'd just try
> Regsvr32 and try and get it registered.
>
> Neil
>
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP06.phx.gbl...
> Try running Help | Detect and Repair in Outlook. It might also be
> worth knowing whether you can run any Outlook automation code in
> Outlook's own VBA environment.
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Neil" wrote in message
> $yx6.1170@newsread2.news.pas.earthlink.net...
>>I have some code I use to create a mail message in Outlook 2003 as
>>follows:
>>
>> Dim objOutlook As Outlook.Application
>> Set objOutlook = CreateObject("Outlook.Application")
>> etc....
>>
>> The code works fine everywhere except on one computer. On that
>> computer, the
>> user gets Error -2147024770: "Automation error. The specified module
>> could
>> not be found."
>>
>> I did some searching online, and I found that most of the time when
>> people
>> got that message, it was because a DLL wasn't registered. So I looked
>> up the
>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object
>> Library," and
>> it referred to msoutl.olb. However, that OLB file can't be
>> registered,
>> because it's not an OCX or DLL.
>>
>> So, any thoughts about what needs to be done here?
>>
>> Thanks!
>>
>> Neil
>>
>>
>
>
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 04 Oct 2007
Posts: 15

PostPosted: Tue Jan 02, 2007 3:10 am    Post subject: Re: Problem with Outlook Automation Reply with quote

Did you check out the other issue I suggested? Repeating:

> It might also be worth
> knowing whether you can run any Outlook automation code in Outlook's own VBA
> environment.

If not, rerun Outlook setup to make sure its VBA component is installed.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $pQ3.2889@newsread4.news.pas.earthlink.net...
> Tried Detect and Repair. Didn't find anything.
>
> I don't think there's anything wrong with the DLL; I just think it's not
> registered. Unfortunately, I don't know which DLL it is. The file referenced
> in Tools | References is msoutl.olb, which, if I understand correctly, is
> just a library referencing other files? So I'm not sure which DLL or OCX is
> causing the problem here, or else I'd just try Regsvr32 and try and get it
> registered.
>
> Neil
>
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP06.phx.gbl...
> Try running Help | Detect and Repair in Outlook. It might also be worth
> knowing whether you can run any Outlook automation code in Outlook's own VBA
> environment.
>
> "Neil" wrote in message
> $yx6.1170@newsread2.news.pas.earthlink.net...
>>I have some code I use to create a mail message in Outlook 2003 as follows:
>>
>> Dim objOutlook As Outlook.Application
>> Set objOutlook = CreateObject("Outlook.Application")
>> etc....
>>
>> The code works fine everywhere except on one computer. On that computer,
>> the
>> user gets Error -2147024770: "Automation error. The specified module could
>> not be found."
>>
>> I did some searching online, and I found that most of the time when people
>> got that message, it was because a DLL wasn't registered. So I looked up
>> the
>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library," and
>> it referred to msoutl.olb. However, that OLB file can't be registered,
>> because it's not an OCX or DLL.
>>
>> So, any thoughts about what needs to be done here?
>>
>> Thanks!
>>
>> Neil
>>
>>
>
>
Back to top
View user's profile Send private message
Neil



Joined: 04 Oct 2007
Posts: 11

PostPosted: Wed Jan 03, 2007 10:26 am    Post subject: Re: Problem with Outlook Automation Reply with quote

Sorry, I thought I had posted it. I guess I forgot.

Yes, when run from within Outlook, the code works. Also, if I use GetObject
to access an open instance of Outlook from another app, it works on this
person's machine. But if Outlook isn't already open, then CreateObject
fails. Interesting.

Someone in the microsoft.public.access.interopoledde newsgroup replied that
this problem has been reported several times with no explanation or
resolution, and suggested GetObject as a workaround.

Neil

"Sue Mosher [MVP-Outlook]" wrote in message @TK2MSFTNGP03.phx.gbl...
Did you check out the other issue I suggested? Repeating:

> It might also be worth
> knowing whether you can run any Outlook automation code in Outlook's own
> VBA
> environment.

If not, rerun Outlook setup to make sure its VBA component is installed.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $pQ3.2889@newsread4.news.pas.earthlink.net...
> Tried Detect and Repair. Didn't find anything.
>
> I don't think there's anything wrong with the DLL; I just think it's not
> registered. Unfortunately, I don't know which DLL it is. The file
> referenced
> in Tools | References is msoutl.olb, which, if I understand correctly, is
> just a library referencing other files? So I'm not sure which DLL or OCX
> is
> causing the problem here, or else I'd just try Regsvr32 and try and get it
> registered.
>
> Neil
>
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP06.phx.gbl...
> Try running Help | Detect and Repair in Outlook. It might also be worth
> knowing whether you can run any Outlook automation code in Outlook's own
> VBA
> environment.
>
> "Neil" wrote in message
> $yx6.1170@newsread2.news.pas.earthlink.net...
>>I have some code I use to create a mail message in Outlook 2003 as
>>follows:
>>
>> Dim objOutlook As Outlook.Application
>> Set objOutlook = CreateObject("Outlook.Application")
>> etc....
>>
>> The code works fine everywhere except on one computer. On that computer,
>> the
>> user gets Error -2147024770: "Automation error. The specified module
>> could
>> not be found."
>>
>> I did some searching online, and I found that most of the time when
>> people
>> got that message, it was because a DLL wasn't registered. So I looked up
>> the
>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library,"
>> and
>> it referred to msoutl.olb. However, that OLB file can't be registered,
>> because it's not an OCX or DLL.
>>
>> So, any thoughts about what needs to be done here?
>>
>> Thanks!
>>
>> Neil
>>
>>
>
>
Back to top
View user's profile Send private message
RobinS



Joined: 04 Oct 2007
Posts: 13

PostPosted: Wed Jan 03, 2007 4:20 am    Post subject: Re: Problem with Outlook Automation Reply with quote

Did you try
objOutlook = New Outlook.Application()
instead of using CreateObject?

I don't know which version of VB you're using. I used this for Excel
with VB2005.

Robin S.
---------------------------------------

"Neil" wrote in message $pQ3.422@newsread4.news.pas.earthlink.net...
> Sorry, I thought I had posted it. I guess I forgot.
>
> Yes, when run from within Outlook, the code works. Also, if I use
> GetObject to access an open instance of Outlook from another app, it
> works on this person's machine. But if Outlook isn't already open,
> then CreateObject fails. Interesting.
>
> Someone in the microsoft.public.access.interopoledde newsgroup replied
> that this problem has been reported several times with no explanation
> or resolution, and suggested GetObject as a workaround.
>
> Neil
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP03.phx.gbl...
> Did you check out the other issue I suggested? Repeating:
>
>> It might also be worth
>> knowing whether you can run any Outlook automation code in Outlook's
>> own VBA
>> environment.
>
> If not, rerun Outlook setup to make sure its VBA component is
> installed.
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Neil" wrote in message
> $pQ3.2889@newsread4.news.pas.earthlink.net...
>> Tried Detect and Repair. Didn't find anything.
>>
>> I don't think there's anything wrong with the DLL; I just think it's
>> not
>> registered. Unfortunately, I don't know which DLL it is. The file
>> referenced
>> in Tools | References is msoutl.olb, which, if I understand
>> correctly, is
>> just a library referencing other files? So I'm not sure which DLL or
>> OCX is
>> causing the problem here, or else I'd just try Regsvr32 and try and
>> get it
>> registered.
>>
>> Neil
>>
>>
>> "Sue Mosher [MVP-Outlook]" wrote in message
>> @TK2MSFTNGP06.phx.gbl...
>> Try running Help | Detect and Repair in Outlook. It might also be
>> worth
>> knowing whether you can run any Outlook automation code in Outlook's
>> own VBA
>> environment.
>>
>> "Neil" wrote in message
>> $yx6.1170@newsread2.news.pas.earthlink.net...
>>>I have some code I use to create a mail message in Outlook 2003 as
>>>follows:
>>>
>>> Dim objOutlook As Outlook.Application
>>> Set objOutlook = CreateObject("Outlook.Application")
>>> etc....
>>>
>>> The code works fine everywhere except on one computer. On that
>>> computer,
>>> the
>>> user gets Error -2147024770: "Automation error. The specified module
>>> could
>>> not be found."
>>>
>>> I did some searching online, and I found that most of the time when
>>> people
>>> got that message, it was because a DLL wasn't registered. So I
>>> looked up
>>> the
>>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object
>>> Library," and
>>> it referred to msoutl.olb. However, that OLB file can't be
>>> registered,
>>> because it's not an OCX or DLL.
>>>
>>> So, any thoughts about what needs to be done here?
>>>
>>> Thanks!
>>>
>>> Neil
>>>
>>>
>>
>>
>
>
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 04 Oct 2007
Posts: 15

PostPosted: Wed Jan 03, 2007 1:44 pm    Post subject: Re: Problem with Outlook Automation Reply with quote

The cause may be an anti-virus program on your computer that has a feature to block Outlook scripting. The solution is to turn off the script blocking feature. You may need to contact technical support for your anti-virus program to find out how to do that.


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $pQ3.422@newsread4.news.pas.earthlink.net...
> Sorry, I thought I had posted it. I guess I forgot.
>
> Yes, when run from within Outlook, the code works. Also, if I use GetObject
> to access an open instance of Outlook from another app, it works on this
> person's machine. But if Outlook isn't already open, then CreateObject
> fails. Interesting.
>
> Someone in the microsoft.public.access.interopoledde newsgroup replied that
> this problem has been reported several times with no explanation or
> resolution, and suggested GetObject as a workaround.
>
> Neil
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP03.phx.gbl...
> Did you check out the other issue I suggested? Repeating:
>
>> It might also be worth
>> knowing whether you can run any Outlook automation code in Outlook's own
>> VBA
>> environment.
>
> If not, rerun Outlook setup to make sure its VBA component is installed.

>
> "Neil" wrote in message
> $pQ3.2889@newsread4.news.pas.earthlink.net...
>> Tried Detect and Repair. Didn't find anything.
>>
>> I don't think there's anything wrong with the DLL; I just think it's not
>> registered. Unfortunately, I don't know which DLL it is. The file
>> referenced
>> in Tools | References is msoutl.olb, which, if I understand correctly, is
>> just a library referencing other files? So I'm not sure which DLL or OCX
>> is
>> causing the problem here, or else I'd just try Regsvr32 and try and get it
>> registered.
>>
>> Neil
>>
>>
>> "Sue Mosher [MVP-Outlook]" wrote in message
>> @TK2MSFTNGP06.phx.gbl...
>> Try running Help | Detect and Repair in Outlook. It might also be worth
>> knowing whether you can run any Outlook automation code in Outlook's own
>> VBA
>> environment.
>>
>> "Neil" wrote in message
>> $yx6.1170@newsread2.news.pas.earthlink.net...
>>>I have some code I use to create a mail message in Outlook 2003 as
>>>follows:
>>>
>>> Dim objOutlook As Outlook.Application
>>> Set objOutlook = CreateObject("Outlook.Application")
>>> etc....
>>>
>>> The code works fine everywhere except on one computer. On that computer,
>>> the
>>> user gets Error -2147024770: "Automation error. The specified module
>>> could
>>> not be found."
>>>
>>> I did some searching online, and I found that most of the time when
>>> people
>>> got that message, it was because a DLL wasn't registered. So I looked up
>>> the
>>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library,"
>>> and
>>> it referred to msoutl.olb. However, that OLB file can't be registered,
>>> because it's not an OCX or DLL.
>>>
>>> So, any thoughts about what needs to be done here?
>>>
>>> Thanks!
>>>
>>> Neil
>>>
>>>
>>
>>
>
>
Back to top
View user's profile Send private message
Neil



Joined: 04 Oct 2007
Posts: 11

PostPosted: Thu Jan 04, 2007 12:58 pm    Post subject: Re: Problem with Outlook Automation Reply with quote

No, that's not it. As stated, it works with GetObject and is able to create
the e-mail. Script blocking would block that as well.

But, it turns out, the fellow in the other forum stumbled upon a solution
that resolved it. Using CreateObject while specifying the host allowed the
command to go through. Don't ask me why (not that you would have anyway
Wink ). But when the following is used:

Set objOutlook = CreateObject("Outlook.Application", "LocalHost")

the problem is resolved. Again, this is only needed on one computer. On all
the others, the second parameter isn't needed. But on this one, CreateObject
only works with the host specified. Strange.

Neil


"Sue Mosher [MVP-Outlook]" wrote in message @TK2MSFTNGP06.phx.gbl...
The cause may be an anti-virus program on your computer that has a feature
to block Outlook scripting. The solution is to turn off the script blocking
feature. You may need to contact technical support for your anti-virus
program to find out how to do that.


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $pQ3.422@newsread4.news.pas.earthlink.net...
> Sorry, I thought I had posted it. I guess I forgot.
>
> Yes, when run from within Outlook, the code works. Also, if I use
> GetObject
> to access an open instance of Outlook from another app, it works on this
> person's machine. But if Outlook isn't already open, then CreateObject
> fails. Interesting.
>
> Someone in the microsoft.public.access.interopoledde newsgroup replied
> that
> this problem has been reported several times with no explanation or
> resolution, and suggested GetObject as a workaround.
>
> Neil
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP03.phx.gbl...
> Did you check out the other issue I suggested? Repeating:
>
>> It might also be worth
>> knowing whether you can run any Outlook automation code in Outlook's own
>> VBA
>> environment.
>
> If not, rerun Outlook setup to make sure its VBA component is installed.

>
> "Neil" wrote in message
> $pQ3.2889@newsread4.news.pas.earthlink.net...
>> Tried Detect and Repair. Didn't find anything.
>>
>> I don't think there's anything wrong with the DLL; I just think it's not
>> registered. Unfortunately, I don't know which DLL it is. The file
>> referenced
>> in Tools | References is msoutl.olb, which, if I understand correctly, is
>> just a library referencing other files? So I'm not sure which DLL or OCX
>> is
>> causing the problem here, or else I'd just try Regsvr32 and try and get
>> it
>> registered.
>>
>> Neil
>>
>>
>> "Sue Mosher [MVP-Outlook]" wrote in message
>> @TK2MSFTNGP06.phx.gbl...
>> Try running Help | Detect and Repair in Outlook. It might also be worth
>> knowing whether you can run any Outlook automation code in Outlook's own
>> VBA
>> environment.
>>
>> "Neil" wrote in message
>> $yx6.1170@newsread2.news.pas.earthlink.net...
>>>I have some code I use to create a mail message in Outlook 2003 as
>>>follows:
>>>
>>> Dim objOutlook As Outlook.Application
>>> Set objOutlook = CreateObject("Outlook.Application")
>>> etc....
>>>
>>> The code works fine everywhere except on one computer. On that computer,
>>> the
>>> user gets Error -2147024770: "Automation error. The specified module
>>> could
>>> not be found."
>>>
>>> I did some searching online, and I found that most of the time when
>>> people
>>> got that message, it was because a DLL wasn't registered. So I looked up
>>> the
>>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library,"
>>> and
>>> it referred to msoutl.olb. However, that OLB file can't be registered,
>>> because it's not an OCX or DLL.
>>>
>>> So, any thoughts about what needs to be done here?
>>>
>>> Thanks!
>>>
>>> Neil
>>>
>>>
>>
>>
>
>
Back to top
View user's profile Send private message
Neil



Joined: 04 Oct 2007
Posts: 11

PostPosted: Thu Jan 04, 2007 12:59 pm    Post subject: Re: Problem with Outlook Automation Reply with quote

Yes.

"RobinS" wrote in message @comcast.com...
> Did you try
> objOutlook = New Outlook.Application()
> instead of using CreateObject?
>
> I don't know which version of VB you're using. I used this for Excel with
> VB2005.
>
> Robin S.
> ---------------------------------------
>
> "Neil" wrote in message
> $pQ3.422@newsread4.news.pas.earthlink.net...
>> Sorry, I thought I had posted it. I guess I forgot.
>>
>> Yes, when run from within Outlook, the code works. Also, if I use
>> GetObject to access an open instance of Outlook from another app, it
>> works on this person's machine. But if Outlook isn't already open, then
>> CreateObject fails. Interesting.
>>
>> Someone in the microsoft.public.access.interopoledde newsgroup replied
>> that this problem has been reported several times with no explanation or
>> resolution, and suggested GetObject as a workaround.
>>
>> Neil
>>
>> "Sue Mosher [MVP-Outlook]" wrote in message
>> @TK2MSFTNGP03.phx.gbl...
>> Did you check out the other issue I suggested? Repeating:
>>
>>> It might also be worth
>>> knowing whether you can run any Outlook automation code in Outlook's own
>>> VBA
>>> environment.
>>
>> If not, rerun Outlook setup to make sure its VBA component is installed.
>>
>> --
>> Sue Mosher, Outlook MVP
>> Author of Configuring Microsoft Outlook 2003
>> http://www.turtleflock.com/olconfig/index.htm
>> and Microsoft Outlook Programming - Jumpstart for
>> Administrators, Power Users, and Developers
>> http://www.outlookcode.com/jumpstart.aspx
>>
>> "Neil" wrote in message
>> $pQ3.2889@newsread4.news.pas.earthlink.net...
>>> Tried Detect and Repair. Didn't find anything.
>>>
>>> I don't think there's anything wrong with the DLL; I just think it's not
>>> registered. Unfortunately, I don't know which DLL it is. The file
>>> referenced
>>> in Tools | References is msoutl.olb, which, if I understand correctly,
>>> is
>>> just a library referencing other files? So I'm not sure which DLL or OCX
>>> is
>>> causing the problem here, or else I'd just try Regsvr32 and try and get
>>> it
>>> registered.
>>>
>>> Neil
>>>
>>>
>>> "Sue Mosher [MVP-Outlook]" wrote in message
>>> @TK2MSFTNGP06.phx.gbl...
>>> Try running Help | Detect and Repair in Outlook. It might also be worth
>>> knowing whether you can run any Outlook automation code in Outlook's own
>>> VBA
>>> environment.
>>>
>>> "Neil" wrote in message
>>> $yx6.1170@newsread2.news.pas.earthlink.net...
>>>>I have some code I use to create a mail message in Outlook 2003 as
>>>>follows:
>>>>
>>>> Dim objOutlook As Outlook.Application
>>>> Set objOutlook = CreateObject("Outlook.Application")
>>>> etc....
>>>>
>>>> The code works fine everywhere except on one computer. On that
>>>> computer,
>>>> the
>>>> user gets Error -2147024770: "Automation error. The specified module
>>>> could
>>>> not be found."
>>>>
>>>> I did some searching online, and I found that most of the time when
>>>> people
>>>> got that message, it was because a DLL wasn't registered. So I looked
>>>> up
>>>> the
>>>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library,"
>>>> and
>>>> it referred to msoutl.olb. However, that OLB file can't be registered,
>>>> because it's not an OCX or DLL.
>>>>
>>>> So, any thoughts about what needs to be done here?
>>>>
>>>> Thanks!
>>>>
>>>> Neil
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 04 Oct 2007
Posts: 15

PostPosted: Thu Jan 04, 2007 12:01 pm    Post subject: Re: Problem with Outlook Automation Reply with quote

That is strange. Good tip.

In my experience, GetObject() doesn't seem to be blocked by anti-virus programs, just CreateObject()

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $yx6.1874@newsread2.news.pas.earthlink.net...
> No, that's not it. As stated, it works with GetObject and is able to create
> the e-mail. Script blocking would block that as well.
>
> But, it turns out, the fellow in the other forum stumbled upon a solution
> that resolved it. Using CreateObject while specifying the host allowed the
> command to go through. Don't ask me why (not that you would have anyway
> Wink ). But when the following is used:
>
> Set objOutlook = CreateObject("Outlook.Application", "LocalHost")
>
> the problem is resolved. Again, this is only needed on one computer. On all
> the others, the second parameter isn't needed. But on this one, CreateObject
> only works with the host specified. Strange.
>
> Neil
>
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP06.phx.gbl...
> The cause may be an anti-virus program on your computer that has a feature
> to block Outlook scripting. The solution is to turn off the script blocking
> feature. You may need to contact technical support for your anti-virus
> program to find out how to do that.
>
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Neil" wrote in message
> $pQ3.422@newsread4.news.pas.earthlink.net...
>> Sorry, I thought I had posted it. I guess I forgot.
>>
>> Yes, when run from within Outlook, the code works. Also, if I use
>> GetObject
>> to access an open instance of Outlook from another app, it works on this
>> person's machine. But if Outlook isn't already open, then CreateObject
>> fails. Interesting.
>>
>> Someone in the microsoft.public.access.interopoledde newsgroup replied
>> that
>> this problem has been reported several times with no explanation or
>> resolution, and suggested GetObject as a workaround.
>>
>> Neil
>>
>> "Sue Mosher [MVP-Outlook]" wrote in message
>> @TK2MSFTNGP03.phx.gbl...
>> Did you check out the other issue I suggested? Repeating:
>>
>>> It might also be worth
>>> knowing whether you can run any Outlook automation code in Outlook's own
>>> VBA
>>> environment.
>>
>> If not, rerun Outlook setup to make sure its VBA component is installed.
>
>>
>> "Neil" wrote in message
>> $pQ3.2889@newsread4.news.pas.earthlink.net...
>>> Tried Detect and Repair. Didn't find anything.
>>>
>>> I don't think there's anything wrong with the DLL; I just think it's not
>>> registered. Unfortunately, I don't know which DLL it is. The file
>>> referenced
>>> in Tools | References is msoutl.olb, which, if I understand correctly, is
>>> just a library referencing other files? So I'm not sure which DLL or OCX
>>> is
>>> causing the problem here, or else I'd just try Regsvr32 and try and get
>>> it
>>> registered.
>>>
>>> Neil
>>>
>>>
>>> "Sue Mosher [MVP-Outlook]" wrote in message
>>> @TK2MSFTNGP06.phx.gbl...
>>> Try running Help | Detect and Repair in Outlook. It might also be worth
>>> knowing whether you can run any Outlook automation code in Outlook's own
>>> VBA
>>> environment.
>>>
>>> "Neil" wrote in message
>>> $yx6.1170@newsread2.news.pas.earthlink.net...
>>>>I have some code I use to create a mail message in Outlook 2003 as
>>>>follows:
>>>>
>>>> Dim objOutlook As Outlook.Application
>>>> Set objOutlook = CreateObject("Outlook.Application")
>>>> etc....
>>>>
>>>> The code works fine everywhere except on one computer. On that computer,
>>>> the
>>>> user gets Error -2147024770: "Automation error. The specified module
>>>> could
>>>> not be found."
>>>>
>>>> I did some searching online, and I found that most of the time when
>>>> people
>>>> got that message, it was because a DLL wasn't registered. So I looked up
>>>> the
>>>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library,"
>>>> and
>>>> it referred to msoutl.olb. However, that OLB file can't be registered,
>>>> because it's not an OCX or DLL.
>>>>
>>>> So, any thoughts about what needs to be done here?
>>>>
>>>> Thanks!
>>>>
>>>> Neil
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Back to top
View user's profile Send private message
Neil



Joined: 04 Oct 2007
Posts: 11

PostPosted: Sat Jan 06, 2007 4:49 am    Post subject: Re: Problem with Outlook Automation Reply with quote

That's interesting about GetObject working with anti-virus programs, but not
CreateObject.

In another twist here, the person on whose machine CreateObject didn't work
without "LocalHost" being specified uninstalled and reinstalled Office 2003,
and now it works fine with the original code (without "LocalHost").
Interesting.

Neil

"Sue Mosher [MVP-Outlook]" wrote in message
news:%23GWUJj$LHHA.2232@TK2MSFTNGP02.phx.gbl...
That is strange. Good tip.

In my experience, GetObject() doesn't seem to be blocked by anti-virus
programs, just CreateObject()

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Neil" wrote in message $yx6.1874@newsread2.news.pas.earthlink.net...
> No, that's not it. As stated, it works with GetObject and is able to
> create
> the e-mail. Script blocking would block that as well.
>
> But, it turns out, the fellow in the other forum stumbled upon a solution
> that resolved it. Using CreateObject while specifying the host allowed the
> command to go through. Don't ask me why (not that you would have anyway
> Wink ). But when the following is used:
>
> Set objOutlook = CreateObject("Outlook.Application", "LocalHost")
>
> the problem is resolved. Again, this is only needed on one computer. On
> all
> the others, the second parameter isn't needed. But on this one,
> CreateObject
> only works with the host specified. Strange.
>
> Neil
>
>
> "Sue Mosher [MVP-Outlook]" wrote in message
> @TK2MSFTNGP06.phx.gbl...
> The cause may be an anti-virus program on your computer that has a feature
> to block Outlook scripting. The solution is to turn off the script
> blocking
> feature. You may need to contact technical support for your anti-virus
> program to find out how to do that.
>
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Neil" wrote in message
> $pQ3.422@newsread4.news.pas.earthlink.net...
>> Sorry, I thought I had posted it. I guess I forgot.
>>
>> Yes, when run from within Outlook, the code works. Also, if I use
>> GetObject
>> to access an open instance of Outlook from another app, it works on this
>> person's machine. But if Outlook isn't already open, then CreateObject
>> fails. Interesting.
>>
>> Someone in the microsoft.public.access.interopoledde newsgroup replied
>> that
>> this problem has been reported several times with no explanation or
>> resolution, and suggested GetObject as a workaround.
>>
>> Neil
>>
>> "Sue Mosher [MVP-Outlook]" wrote in message
>> @TK2MSFTNGP03.phx.gbl...
>> Did you check out the other issue I suggested? Repeating:
>>
>>> It might also be worth
>>> knowing whether you can run any Outlook automation code in Outlook's own
>>> VBA
>>> environment.
>>
>> If not, rerun Outlook setup to make sure its VBA component is installed.
>
>>
>> "Neil" wrote in message
>> $pQ3.2889@newsread4.news.pas.earthlink.net...
>>> Tried Detect and Repair. Didn't find anything.
>>>
>>> I don't think there's anything wrong with the DLL; I just think it's not
>>> registered. Unfortunately, I don't know which DLL it is. The file
>>> referenced
>>> in Tools | References is msoutl.olb, which, if I understand correctly,
>>> is
>>> just a library referencing other files? So I'm not sure which DLL or OCX
>>> is
>>> causing the problem here, or else I'd just try Regsvr32 and try and get
>>> it
>>> registered.
>>>
>>> Neil
>>>
>>>
>>> "Sue Mosher [MVP-Outlook]" wrote in message
>>> @TK2MSFTNGP06.phx.gbl...
>>> Try running Help | Detect and Repair in Outlook. It might also be worth
>>> knowing whether you can run any Outlook automation code in Outlook's own
>>> VBA
>>> environment.
>>>
>>> "Neil" wrote in message
>>> $yx6.1170@newsread2.news.pas.earthlink.net...
>>>>I have some code I use to create a mail message in Outlook 2003 as
>>>>follows:
>>>>
>>>> Dim objOutlook As Outlook.Application
>>>> Set objOutlook = CreateObject("Outlook.Application")
>>>> etc....
>>>>
>>>> The code works fine everywhere except on one computer. On that
>>>> computer,
>>>> the
>>>> user gets Error -2147024770: "Automation error. The specified module
>>>> could
>>>> not be found."
>>>>
>>>> I did some searching online, and I found that most of the time when
>>>> people
>>>> got that message, it was because a DLL wasn't registered. So I looked
>>>> up
>>>> the
>>>> reference (in Access 2003) to "Microsoft Outlook 11.0 Object Library,"
>>>> and
>>>> it referred to msoutl.olb. However, that OLB file can't be registered,
>>>> because it's not an OCX or DLL.
>>>>
>>>> So, any thoughts about what needs to be done here?
>>>>
>>>> Thanks!
>>>>
>>>> Neil
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Back to top
View user's profile Send private message
Mike



Joined: 04 Oct 2007
Posts: 15

PostPosted: Sat Jan 06, 2007 4:53 am    Post subject: Re: Problem with Outlook Automation Reply with quote

"Neil" wrote:

>> Set objOutlook = CreateObject("Outlook.Application", "LocalHost")

Are there any downsides to specifically using "LocalHost" as the
server name?

I am asking because I am thinking of adding this as a preemptive fix
to the automation error. Whenever I get a bug report for "Error
-2147024770: Automation error. The specified module could not be
found.", I always raise the possibility of script blocking anti virus
software, but this would be a great if it could eliminate most of
those support calls.

-mike
Back to top
View user's profile Send private message
Neil



Joined: 04 Oct 2007
Posts: 11

PostPosted: Mon Jan 15, 2007 12:09 pm    Post subject: Re: Problem with Outlook Automation Reply with quote

I don't see any, personally, as long as Outlook's installed locally. But
this isn't my code anyway. You might want to post your question in the forum
I referenced earlier in this thread, where the person who came up with this
posted it.

"Mike" wrote in message @4ax.com...
> "Neil" wrote:
>
>>> Set objOutlook = CreateObject("Outlook.Application", "LocalHost")
>
> Are there any downsides to specifically using "LocalHost" as the
> server name?
>
> I am asking because I am thinking of adding this as a preemptive fix
> to the automation error. Whenever I get a bug report for "Error
> -2147024770: Automation error. The specified module could not be
> found.", I always raise the possibility of script blocking anti virus
> software, but this would be a great if it could eliminate most of
> those support calls.
>
> -mike

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Outlook Automation: Permissions Problem We have VB6 app which creates an Outlook Application instance and interacts with various Outlook Some of our users, who are always Outlook clients on corporate laptops (setup up with various permissions by the corporate IT department), are

Outlook automation from vb6 I am using MAPI to send e-mails from vb6 through Outlook 2003. A security message appears for every e-mail sent. (A program is trying to access e-mail I have used a product called ClickYes, but I want to control this through my vb6 applica

Automation outlook Bonjour, Je voudrais recuperer par ole automation, les adresses des contacts dans outlous, si les contacts contiennes des liste de distributions recuperer aussi les contacts de ces listes par categories Avez-vous une idée ou pouvez vous m'aider Soit en VB

Help on Outlook 2000 automation HI, Our application (frontend - VB) is using Outlook to send emails and is trapping the Close event and doing some processing before closing the mailitem. It was working well will MS Outolook Object 8.0 Library and Outlook 97. But now the customer is upgr

Problem opening Excel app via automation Hello, I have a VB6 exe front end that opens an Excel VBA app via automation. I am running it under a Virtual PC Win 2k Office 2K testbed. I have previously run it without problem on my host Win XP Pro Office 2003 system. The Excel VBA portion opens witho
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group