Tech Support Guy banner

Library not Registered error - VBA Outlook

16316 Views 14 Replies 4 Participants Last post by  OBP
Been running this email generation VBA code for years (currently Access 2013) and this week it went south on me. But another person in my group runs the process just fine from his PC.
The error:
Run-time error '-2147319779 (8002801d)':
Automation error
Library not registered.

OS=Win7 (Office 365 thing going) running Access 2013 and Outlook 2013 on corporate LAN.

The offending line of code is:
Set MyOutlook = New Outlook.Application

This doesn't work either:
Set MyOutlook = GetObject(, "Outlook.Application.15")

Lots there on Google but nothing giving me confidence to edit the registry yet. Hoping you guys helping on all the Excel notification request here have seen this.

Thanks for reading my post
Not open for further replies.
1 - 15 of 15 Posts
What is showing when you display your references in the VB editor?

You might be able to just re-register a DLL or something using the rgsvr32 command.
Can you try this

Dim MyOutlook as object
Set MyOutlook = CreateObject("Outlook.Application")

have you checked your reference to ensure nothing is missing?
I'm not inclined to think changing the code is going to fix the problem since this runs on two other users PC. I'm thinking a registry issue,

This is in the Code
Dim MyOutlook As Outlook.Application
Rollin my References look like the attached:

References look same on working PCs as well


See less See more
You have Outlook 2015 registered, but your system description says Outlook 2013.
"OS=Win7 (Office 365 thing going) running Access 2013 and Outlook 2013 on corporate LAN.

So which is it?
and what have the working computers got?

Have you recently had a big MS update like me?
I am appreciating all the help!
OBP, Outlook version 15.0 is actually Outlook 2013 (outlook 2010 is 14.xx, etc)
Working computers are the same.

We are on office 365 but network admins don't allow new stuff to deploy until they've tested against all the other crap we have running here. I think 365 is wanting to push Office 16 right now. We've changed network vendors recently and I've lost my "goto" contacts in that group. So I can't say for sure what they are up to.
It could be the Run time scripting is the problem and you need to re-register it.
Have you tried unticking them, close down the Access, reopen Access and then see if you can register the libraries again>
I think I'm on to something. appears there's an office16 folder in my Program Files(x86) folder dated 5/8/2016. This coincides with it not working Monday. The joy of having other people jerking around on your machine.

Not sure what to do now but I bet that's it. It couldn't find MSOUTL.OLB when I tried to register. My office crap all shows to be 2013. Would like finish installing 2016 but I support users on 2013??

Every thing else is working fine. I'll look fresh at the problem tomorrow.

Thanks for hanging with me.
It couldn't find MSOUTL.OLB when I tried to register
in the VBE IDE under Tools > Reference if you click the browse button then try to locate the MSOUTL.OLB file you may be able rectify the problem.

C:\Program Files (x86)\Microsoft office\Office14\MSOUTL>OLE

the path may be slightly different on your machine.

Also as I previously mentioned, if you use late binding you will not need to add references. I use Access a lot and send reminder emails from it daily and I have no references set for Outlook, I instead create the object with the code when I need it like this

Dim iOutlook as Object
Set iOutlook = CreateObject("Outlook.Application")
I'm trying to implement the late binding scenario and got past the initial error and now failing on this statement:
Set MyMail = MyOutlook.CreateItem(olMailItem)

That's in a Do Until loop that gathers the email addresses, formats the body for address.
Does it fail the first time you attempt it?
Hhave you dimensioned the MyMail as a MailItem

Dim objMessage As MailItem
Set objMessage = objOutlook.CreateItem(olMailItem)
Without seeing the entire sub I cannot really recreate the code as I don't know what that procedure is trying to do. Its not as easy as changing one line of code, you will need to make the change in a few places. If you can upload the block of code we can make an attempt to recreate it for you.
While I appreciate the help, DataBase your earlier post insinuated it was as easy as changing a couple of lines of code.
Can you try this

Dim MyOutlook as object
Set MyOutlook = CreateObject("Outlook.Application")

have you checked your reference to ensure nothing is missing?
There has to be a correct reference to outlook regardless of when the binding occurs. My problem is with Office 365 and the environment I'm trying to run in, not VBA.
Well, My VBA reference issue fixed itself. Either by the network gods fixing their problem or some other miracle. There is a version of MSOUTL.OLB in Office16\Program Files(x86) dated 5/8/2016. That's when it quit working. My references are still pointed at Outlook 15 Object Lib.

I suspect correctly registering the OLB would have solved my issue. I could run the process on other machines so I wasn't going to upset the network admins and start hacking my registry without their blessing.

Note: I had left some of the 'late binding' code in place when it started working. But it wasn't going to work without a good reference.

Thanks to all who looked at this with me.
Glad it was resolved.
Sounds like an MS update.
1 - 15 of 15 Posts
Not open for further replies.