References problem

This is  an Access 2010 manufacturing system used on 8 pc's in our business. I have added a Reference to the Microsoft Outlook Object Library because my application interacts with Outlook on a couple of the office pc's. This created a problem because some of the pc's in the factory do not have ms office installed. So I placed a copy of MSOUTL.OLB in the c:\temp folder on everybody's pc. I also had to remove this file from the MS Office folder on my office pc in order to force Access to keep a reference to the MSOUTL.OLB i placed in the temp folder.

My problem is that  on my pc Access keeps adjusting the reference to point back at the c:\program files\microsoft office folder even  though the file is not there. I think it must be seeing the file in the temp folder because my code compiles without complaining about the missing reference. When I distribute the .ACCDB to a machine which does not have ms office, then the missing reference is a problem even though each machine has the file in the temp folder.

I've tried programatically adding the reference like this:

access.references.AddFromFile "C:\temp\msoutl.olb"

The reference is then visible in the list of references, but the path is once again shown as C:\program files\ms office.

How do I fix this?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<How do I fix this? >>

1. You buy and install Office for all the PC's.  What your doing at the moment is not legal.   Second part of that is you will not get this to work by simply moving a single DLL our OCX.  Software is a lot more complex than it was in the past consiting of multiple files, specific locations, registry keys, etc.

2. You don't use Outlook.  If your simply sending e-mail, there are other ways to do that such as using BLAT or vbSendMail, or some other 3rd party lib which talks directly to a SMTP server.

  If your using something in outlook outside of mail, then you can possibly used CDO, which is built into windows.

3. Remove the functionality from the app that depends on Outlook.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TownTalkAuthor Commented:
Thanks Jim, It never occurred to me that there is a legal issue here. The Factory pc's do not run MS Outlook, or the part of this system that interacts with it. I just need the application to be happy in that environment and it seemed an easy way out by putting the OLB file there.
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Yes, a lot of people don't think of that.  They assume because something is referenced in the reference list, they are allowed to use it.

 That's not the case.   Items appearing in the reference list just means it's installed in on the machine where your developing, not that you have the right to distribute it with an application.

 For example, many are unaware that you cannot distribute any of the Access wizards found in the full product with an app you create and distribute with the run-time version.   Only users with a full copy of Access are legally allowed to run the wizards, even though you might call them from code.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.