Results 1 to 3 of 3
  1. #1
    jcc285 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    70

    Reference to Excel Object Library


    I have an Access database written in Access 2016. One of my users, at another location, has Office 2013. The database exports a small number of Excel files via VBA Code. When my user starts his copy of my database a number of error/warning messages flash onto the screen regarding 'Excel' they are very quick so I cannot give an absolute reading of the message. I have discovered that I can stop this behavior by opening a VBA Editor on my users machine and adding the MS Office 13 Excel Object Library to the project. This is not very satisfactory as on my machine the reference is to MS Office 16 Excel Object Library.
    I have also noticed that when opening VBA Editor on the users machine my reference to MS Office 16 Excel Object Library has disappeared from the included reference list.

    If I want to issue a compiled .accde file to my user is there a way to include both references in the project or are they mutually exclusive ?

    Lastly, I do not have MS Office 13 Excel Object Library as an available reference in my drop down available list from VBA Editor Tools>References on my machine so cannot pre-include this for my user.

    Any help gratefully received.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    usual thing to do is what is called late binding - declaring excel in references is early binding and creates the sort of issues you are getting.

    There is plenty about late binding on the web - here is a link which should tell you what you need to know

    http://www.excelguru.ca/forums/showt...h-Late-Binding

    and here is a more detailed one on the subject

    https://support.microsoft.com/en-us/...-in-automation

    main thing to remember is to determine the constant values referenced by name. You can either then declare them as in the first post (recommended) or just use the numerical value in the code. You can find that whilst still early bound by hovering over the value when the code is running (use breakpoints) or in the immediate window type for example

    ?xlTemplate

    or hit F2 to open the object browser and find them there.

  3. #3
    jcc285 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    70
    [QUOTE=Ajax;357198]usual thing to do is what is called late binding - declaring excel in references is early binding and creates the sort of issues you are getting.

    There is plenty about late binding on the web - here is a link which should tell you what you need to know

    http://www.excelguru.ca/forums/showt...h-Late-Binding

    and here is a more detailed one on the subject

    https://support.microsoft.com/en-us/...-in-automation

    main thing to remember is to determine the constant values referenced by name. You can either then declare them as in the first post (recommended) or just use the numerical value in the code. You can find that whilst still early bound by hovering over the value when the code is running (use breakpoints) or in the immediate window type for example

    ?xlTemplate

    or hit F2 to open the object browser and find them there.[/QUOTE

    Thank you for prompt response and for the links. This is what I needed to know
    Most grateful

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-04-2016, 09:32 AM
  2. Replies: 7
    Last Post: 04-22-2016, 08:19 AM
  3. Replies: 5
    Last Post: 09-09-2014, 09:36 AM
  4. MU File Reference Library
    By dandoescode in forum Access
    Replies: 17
    Last Post: 06-20-2012, 12:40 PM
  5. Replies: 8
    Last Post: 05-26-2011, 07:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums