Outlook 9.0 Object Library reference changes to 11.0

SteveF

New Member
Joined
Jun 15, 2004
Messages
27
I need some help with a strange error that happens intermittently.

I have an Excel VBA process that formats some reports and sends them as email attachments. The process works flawlessly EXCEPT that OCCASSIONALLY the reference that I have to the Microsoft Outlook 9.0 Object Library will change to Microsoft Outlook 11.0. When this happens, it can't find the msoutl.olb object library because the 11.0 reference points to a folder I don't have (c:\Program Files\Microsoft Office\OFFICE11\msoutl.olb).

To fix the problem, I un-select the 11.0 reference and re-select the 9.0 reference, save the project, and it works for several days. But then it seems to change itself back to the 11.0 reference and stops working. This process runs on an unattended workstation, so no other Excel activity is happening.

Any help on this strange issue would be greatly appreciated!

Thanks,
Steve
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

CDICKENS

Active Member
Joined
Mar 24, 2002
Messages
498
I would suggest you use late-binding. That way it doesn't matter which version of Outlook someone has. And the references do not get bungled.

With late-binding you do not have to set a reference manually, the reference is set through code.

Code:
Dim oOutlook As Object
Set oOutlook = CreateObject("Outlook.Application")

I usually develop code using references and early binding and then convert my code to late-binding when deployed. That is if I am not guaranteed that every user has the same version of office.

Chuck
 

Watch MrExcel Video

Forum statistics

Threads
1,118,448
Messages
5,572,166
Members
412,447
Latest member
immy
Top