>>>>
Dim oBizObj As New myClass>>>
>>>
Never use the above, use the code below, there are almost no good reasons to use the above: >>>
>>>>or
>>>>
Dim oBizObj As myClass
>>>>Set oBizObj = New myClass>>
>>Thanks. Never heard that before, can you explain?
>
>When using the first syntax, VB delays instanciation until the first use of the class. Let me demonstrate it:
>
>If you write:
>
dim x as new class1
>x.prop1 = "value"
>x.prop2 = "value"
>x.method
>
>VB will compile it this way (to instantiate the class on the first use):
>
dim x as class1
>if x is nothing then set x = new class1
>x.prop1 = "value"
>if x is nothing then set x = new class1
>x.prop2 = "value"
>if x is nothing then set x = new class1
>x.method
>
>Calling yourself the New operator (like your second syntax) allows VB not to execute more statements!
George