Early Versus Late Binding of Object Variables

If a given object is defined to be a specific type at design-time, such as with the following statement, it is bound to that data type at design-time:

Dim docObj As Visio.Document

This is referred to as early binding. Design-time checks, such as testing assignment statements, can ensure the correct data type is being used. This strategy creates more efficient runtime code.

If late binding is used, the type of the object must be determined at runtime, and assigning the wrong type of data to the object can cause a runtime error. The following statement is an example of late binding:

Dim docObj As Object

Get Professional Development with Visio® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.