> Also, is there a destructor in VBA?
The Terminate method is called when the class is destroyed.
Private Sub Class_Terminate()
' your code here
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
"vivmaha" <(E-Mail Removed)> wrote in message
news

F950671-3CC7-4416-A0F2-(E-Mail Removed)...
> Sorry.
>
> When he said "Class_Initialize" i assumed I had to put the class name
> where
> "class" was.
>
> I put "Class_Initialize" and it worked.
>
> Thanks.
>
> Also, is there a destructor in VBA?
>
> "Chip Pearson" wrote:
>
>> What does "did not work" mean? The Class_Initialize procedure is within
>> the
>> class module and is automatically called when an instance of the class is
>> created. VBA does not allow for alternate constructors.
>>
>>
>> --
>> Cordially,
>> Chip Pearson
>> Microsoft MVP - Excel
>> Pearson Software Consulting
>> www.cpearson.com
>> (email on the web site)
>>
>>
>> "vivmaha" <(E-Mail Removed)> wrote in message
>> news:0129ADC7-9963-4C26-A0BB-(E-Mail Removed)...
>> > Hi, this did not work.
>> >
>> > Thanks.
>> >
>> > "JE McGimpsey" wrote:
>> >
>> >> In the class module use the object_Initialize event, e.g.:
>> >>
>> >> Private Sub Class_Initialize()
>> >> 'Do something
>> >> End Sub
>> >>
>> >> In article <D17785BC-4B07-438A-B65D-(E-Mail Removed)>,
>> >> vivmaha <(E-Mail Removed)> wrote:
>> >>
>> >> > How do i make a constructor in VBA?
>> >> > I search one the web and help for 'constructor' but found nothing.
>> >> >
>> >> > Thanks.
>> >>
>>