• A Discussion On Early vs Late Binding

    What is "Binding"?
    "Binding" is essentially the process of connecting to the object model of an application to make use of its objects, properties and methods. There are two methods to accomplish this: Early Binding and Late Binding.

    Early Binding:
    Early binding is the process of explicitly setting a reference to the library which contains the object model you wish to access. This is done by going to Tools|References in the Visual Basic Editor, (as shown here,) and placing a check mark next to the code library you wish to access.
    • Better performance than a Late bind
    • The object library is exposed to "intellisense" should you need to make any modifications
    • You can search the code library in the object browser
    • Makes it easier to see what arguments are required when developing code
    Late Binding:
    Late binding still attaches to the code library, but it does so at runtime.
    • Makes the code more portable to other projects as you do not need to set a reference in the new project
    • Easier for beginners to add to a project as it does not require setting references
    • Eliminates a potential issue with sharing projects between different versions of an application. (Libraries are automatically upgraded, causing code to error when sent back to the lesser version.)
    More Information:
    For more information, you may be interested in reading Bob Phillips article at xldynamic.com which explains how to convert an Early Bind to a Late Bind.

    In Summary:
    Due to the value of tools available when using an Early bind, it is recommended to use an Early bind to develop code. Once done, however, the code should be converted to a Late bind for general release since it is more portable and robust for environments which house multiple versions of applications.

  • MVP Logo
  •  Donations

    If you like our website and would like to give something in return, you can make a donation. All donations are gratefully received and go to support the site.


    Select your preferred currency and donation amount, then click the donate button.

  • Recent Forum Posts

    Colo

    How to Rename a File from English to Other Language?

    Yeah, some massive HTML conversion is my line. In other words, most of difficult things can be done with Excel alone like this time. Well done, Excel!...

    Colo Today, 07:36 AM Go to last post
    Ken Puls

    Link a series name to a cell using Excel 2010 VBA

    Hi there,

    I recorded linking the title to a cell and it came back with the following. Does this help?

    Code:
        ActiveChart.SetElement
    ...

    Ken Puls Today, 04:06 AM Go to last post
    Ken Puls

    How to Rename a File from English to Other Language?

    Colo, that was way too easy... I was expecting some massive HTML conversion, or a huge engine to compare each character against a library of Chr codes!...

    Ken Puls Today, 04:02 AM Go to last post
    Ken Puls

    Shared file\macro & IP address

    Oh, and as for the max number of users who can access the file in the shared folder at once...

    • For reading, I believe it's unlimited. (The second and
    ...

    Ken Puls Today, 03:59 AM Go to last post
    Ken Puls

    Shared file\macro & IP address

    ibrahimaa,

    There is no one-line way to get your IP address the way you are getting the username. So you're going to need more code than...

    Ken Puls Today, 03:56 AM Go to last post