Access 2013 - RunTime Compile: Missing References Excel 14-15

I have an Access 2013 (32 bit) app that I've developed.  It contains an export feature to "inject" data into Excel worksheets.

The problem I have is that I've compiled it using  a reference to the Microsoft Office 15.0 Object Library and Microsoft Excel 15.0 Object library (Office 2013).  When my users install it on their PC and have Office 2010  (which uses the Microsoft Office 14.0 Object Library and Microsoft Excel 14.0 Object library) the application throws an error on start-up and I have to go in manually, open VBA / Tools / References (shows Missing: Microsoft Office / Excel 15.0 Object Library) and set the reference back to Microsoft Office 14.0 Object Library and Microsoft Excel 14.0 Object library.

Works fine if the user has Office 2013 installed but breaks if the user has Office 2010 installed.  

I need a way to trap this error and set the references dynamically based on the version of Office they are using.

HELP!  This is causing a lack of confidence on the part of the client and I don't blame them.
VBA-Reference-Screen-Office-2013.png
4GvnNot4GotnPresidentAsked:
Who is Participating?

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

x
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.

Rey Obrero (Capricorn1)Commented:
to avoid this error, use late binding instead of early binding in your  VBA codes
see this links for references


http://support.microsoft.com/kb/245115

http://www.granite.ab.ca/access/latebinding.htm
0

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
4GvnNot4GotnPresidentAuthor Commented:
Thanks for the note.  How do I check to see which version that they are using and bind to the references for that version at run-time (not just kick out an error)?
0
4GvnNot4GotnPresidentAuthor Commented:
Great catch!  Thanks!
0
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.