Link to home
Start Free TrialLog in
Avatar of Sandra Smith
Sandra SmithFlag for United States of America

asked on

What type binding VBA to use if unknown library references

I have a new client and am creating a simple ACCESS 2010 database.  But I do not know what reference libraries have been checked on the different machines.  What would be the best way to approach this unknown?  Say I need to creat an Excel workbook in an ACCESS module, what would be the best approach if I am unsure whether they have the Excel library checked?
ASKER CERTIFIED SOLUTION
Avatar of Gregory Miller
Gregory Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sandra Smith

ASKER

All my web searching and I never came across this article, which was exactly what I needed.  thank you.
Opps... wrong comment for wrong question... lol

Thanks...!
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Just a note  re "if I am unsure whether they have the Excel library checked?"

Well, it doesn't exactly work like that. If *your* app has the Excel Library check in References, then ... in *most* cases, that Reference will automatically be set on a user's system where you install your db.

So, Early Binding vs Late Binding isn't really about a Reference being 'checked' per se. The case for using Late Binding (with a possible - performance hit) is when you are installing your db on systems which may have different (usually later) versions of Access/Office/Windows - which can (and does) often lead to ... confusion in References getting 'set' correctly.

So for example, at my work ... all users have the exact same version of Windows/Office, so Early Binding is not really an issue.  On the flip side, if I was shipping an app out in the wild - and I wasn't absolutely sure what the environment was going to be - then I would probably be using Late Binding.

mx
Also, here are a couple more articles you may find useful on the subject:

Using early binding and late binding in Automation
http://support.microsoft.com/kb/245115

Late Binding in Microsoft Access
http://www.granite.ab.ca/access/latebinding.htm
Techno dweeb LOL!!!! No matter, it answers my question!

DatabaseMX, the environment is unknown to me so late binding will do the job.  I have asked them repeatedly for me to test, but so far they have not had the "time" to let me!  Good thing they like what I have created so far in the demos!

Thank you both.