troubleshooting Question

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

Avatar of 4GvnNot4Gotn
4GvnNot4GotnFlag for United States of America asked on
Microsoft Access
3 Comments1 Solution5971 ViewsLast Modified:
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros