Monday, July 13, 2009

Early and Late Binding

Declaring an variable with specific object type called Early Binding.
Example:

'  Create a variable to hold a new object of type File Stream.
Dim fs As System.IO.FileStream

Declaring an variable with type object called Late Binding,
later this variable can hold any object type.

' Create a variable to hold a new object
Dim
anyObject As Object
or
Dim fs

' Later you can assign any object type to this variable
anyObject = CreateObject("Excel.Application")
or you can use the anyObject to hold any other your object type
anyObject = CreateObject("Define.Start")




0 comments:

My Achievements

Member of

Blog Archive

Followers

free counters