Results 1 to 4 of 4
  1. #1
    Tenmakk is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    35

    Downgrading Office as a quick fix instead of redoing project using late binding?


    Hello. I have been programming my project using Access 2016, and it needs to be used on a couple of computers with Access 2010. Unfortunately, when I try to install my program on the PCs with 2010, I get an unfriendly error saying "Missing: Excel 16..." I keep needing to manually go into tools>references to fix it. I want the program to be user-friendly. I've been told, twice, that I need to redo my project using late binding, but I have no idea how to do that (and I really do not want to rewrite my code as it is already pretty complicated.).

    If I decide to downgrade my computer from Office 2016 (which I'm using to program) to Office 2010, would that solve the problem? What would I need to do, just save the project in 2010 here once I downgrade, and it will be ready for the 2010 computers I want to install this on?

    Thanks for your help,
    Brad

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    While using Office 2010 on my development machine and employing early binding to automate applications within the Office suite, clients with later versions of Office will do a Just In Time Compilation of my app and correct the reference. Developing in 2013 or 2016 and expecting earlier versions to understand the correct path to the program files will fail.

    If you like your machine that has 2016 on it. I say go ahead and keep using it. There are a couple of tricks you can do.

    What I prefer to do is have a couple machines with earlier versions (and even later versions). You need them for testing and such, anyway. Maybe have a couple boxes with dual boot. I tend to leave the early binding in tact. What I will do is use the machine with the earliest version (or an earlier version) to do final edits and change references. In the end, I may have two or three versions created by two or three machines.

    Another approach would be to change out all VBA references to the application and use the generic Object as your declaration. This is not usually a big job. However, if you have several lines of declarations that go layers deep into the referenced application. It can be cumbersome.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Personally I prefer late binding - fewer issues with different users having different versions, particularly if supplied as .accde.

    It is not difficult to convert - typically a couple of declarations per instance plus replacing 'bound' constants with either their actual value or redeclare the constant - either way you will need to know the value.

    So for example

    an early bound declaration might be

    dim FS as FileSystemObject
    Set FS=new FileSystemObject

    Converted to late bound it would be

    Dim FS As Object
    Set FS = CreateObject("Scripting.FileSystemObject")

    for the constants - there are a number of ways to determine them.

    whilst still bound

    a) run the code, pause and hover over the constant (or debug.print it) or
    b) open the object browser (or hit F2) and type in the name or
    c) in the immediate window type ? followed by the name of the constant
    d) look online for a reference - something like Scripting.FileSystemObject constants

    Having determined its value, you can the replace the constant name with the actual value or my preference is to declare it as a constant either locally in the sub/function, at the module level or more usually as a global constant, just depends on the requirement.

  4. #4
    Tenmakk is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    35
    Thanks. Haven't been given an example before. I'll look into the late binding a bit more.

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

Similar Threads

  1. Using Late Binding in creating custom ribbons
    By Demerit in forum Programming
    Replies: 2
    Last Post: 08-25-2015, 04:17 PM
  2. Late Binding Outlook Tasks and Appointments
    By sstiebinger in forum Programming
    Replies: 2
    Last Post: 08-21-2015, 02:20 PM
  3. Replies: 4
    Last Post: 11-16-2014, 09:56 AM
  4. send outlook email with late binding
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 01-24-2014, 09:39 AM
  5. How do I achieve late binding on a Chart?
    By RocketMonkey in forum Forms
    Replies: 1
    Last Post: 02-12-2013, 02:11 PM

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