locked
Access 2010 & Outlook/Excel 2013 RRS feed

  • Question

  • Dear All,

    We have an MS-Access 2010 application which "speaks" to Excel and to Outlook (for importing and sending data). For this the "14.0 Object Libraries" (for Excel and Outlook) are declared in "References". That all works fine.

    How some users (not all) have been upgraded to Office 2013 (but have still retained Access 2010) and so now the References to the 14.0 Object Libraries is "broken" and the application (understandably) won't compile.

    What can we do about this? Can we somehow make sure the 14.0 Libraries are available?  Or will 2010 work with the 2013 (15.0, I imagine) libraries.

    This is a real show-stopper for us so any help would be most gratefully received.

    Regards and thanks,

    Alan

    Cologne

    Wednesday, February 22, 2017 9:58 AM

All replies

  • Hello Alan,

    > the References to the 14.0 Object Libraries is "broken" and the application (understandably) won't compile.

    You need to set the Copy Local property of the PIA references to true to be able to build the project successfully. The solution should work with the lower version of PIAs in the same way as it was earlier, see Running Solutions in Different Versions of Microsoft Office for more information.

    However, VSTO uses interop libraries for detecting the target Office version. So, in that case you need to replace them with the newest ones. Remove old "broken" references and add PIAs that correspond to the installed Office version.

    1. In Solution Explorer, right-click your project's name and then click Add Reference. The Add Reference dialog box appears.

    2. On the Assemblies page, select Microsoft.Office.Interop.Outlook in the Component Name list. If you do not see the assemblies, you may need to ensure they are installed and displayed (see How to: Install Office Primary Interop Assemblies).


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, February 22, 2017 1:17 PM
  • Normally, they libraries will automatically adjust themselves when you have a newer version.  It just works.  The key element here is that you must always do your development with the oldest setup that it will be run on.  So if you have user with Access 2010 and Office 2010 & 2013, then you need to perform all your dev on Access 2010 and Office 2010 and distribute that to all your users.  It is also critical that they not share a common copy of the FE.  Each user must have their own copy of the FE.  Your database is split, right?!

    But the true way around this whole mess is to use Late Binding and not set reference libraries in the first place.  Google the subject and you'll find many articles that explain the concept and how to implement it.  The good thing is it is very easy to switch from Early Binding (your current approach) to Late Binding.  Here's one article on the subject: VBA – Early Binding and Late Binding


    Daniel Pineault, 2010-2016 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net




    Wednesday, February 22, 2017 1:45 PM
  • I would highly recommend using late binding (CreateObject) instead of early binding for automation when supporting multiple versions of Office. This should enable your 2010 application to function with newer versions of Office.

    Using early binding and late binding in Automation


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Wednesday, February 22, 2017 2:11 PM
  • Hallo Eugene,

    The late-binding option sounds very promising. I'll explore that and give feedback.

    Many thanks,

    Alan

    Wednesday, February 22, 2017 4:46 PM
  • Alan,

    The late-binding technology makes sense in case of VBA macros. You need to use PIAs anyway in .Net applications. 


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, February 22, 2017 4:53 PM