outlook automation object error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all, when using the following code i get this run time error:
"run-time error '-2147024770 (8007007e), automation error, the specified
module could not be found"

<>
Function fnSendMessage(Optional strAttachment As String) As Integer
Dim objOutlook As Outlook.Application
Dim objOutMsg As Outlook.MailItem
Dim objOutRecip As Outlook.Recipient
Dim objOutAttach As Outlook.Attachment

On Error GoTo Errortrap

Set objOutlook = CreateObject("Outlook.application")
<>

The error shows at the set object line. Its rather strange as i have used
this same code before without any problems. I have checked the macro security
level in outlook and it is set to Low. Therefore i can not see any reason why
it would reject it. I have the following references set in connection to
this:

outlook 11.0 obj lib
office 11.0 obj lib
ole automation

Has anyone had this problem before or does anyone have any ideas?
Your help is much appricated!
Kind regards,
Dave
 
Dave, I have the same problem on a few machines. I am investigating as well.
If you come accross a solution please let me know. I will do the same.
 
Dave, I found one solution that may help. I put an On error Resume Next
statment right before the CreateObject statment then on the next line I added
getobject(,"Outlook.application")

This worked if Outlook was running but still craps out if not running. So
I'm thinking that I have make outlook start if it is not running. Let me know
how you make out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top