VBA icon

Why I prefer late bound code

A recent discussion on the Excel-L mailing list had me thinking about late bound versus early bound, and why I prefer late bound VBA code. Someone posted some code there to solve someone else's problem and mentioned that you had to set a reference to a certain object library before running the code. I suggested a late bound version that would also work, without setting a reference.

So I feel the need to explain why I like late bound code.

Continue Reading: Why I prefer late bound code »

Excel iconVBA icon

Take advantage of Intellisense when writing late bound code

Many people are familiar with the page on binding found on Dick Kusleika's website "Dick's Clicks" which advises the following:

To get the most out of the VBA development environment and still write robust code, you should write the code early bound, but change it to late bound before distributing it. Even if you write it for personal use only, it makes sense to convert it to late bound. Someday you will have a different computer or send it to your brother and it won't work because they will have an earlier version. If you're a die-hard procrastinator like me, you will be cursing yourself for not converting to late bound sooner.

Continue Reading: Take advantage of Intellisense when writing late bound code »

Site last updated: February 9, 2012