E
e_hobsbawm
As in other languages, I guess it's considered good form to free
allocated variables.
I have a global variable of tyoe myObjectClasss, which I declare in the
module header like this:
Option Explicit
dim myObject as myObjectClass
I have made a sub updateMyObject which looks like this
Sub updateMyObject(a as integer)
If myObject = Nothing Then
set myObject = new myObjectClass
end if
myObject.initialize(a)
end Sub
I then have a lot of subs and functions that use myObject. It seems to
work fine.
However, Excel always crash when I shut it down. I am slightly worried
that it is because I never free myObject.
Would it be better if I set the variable in workbook_open and set it to
nothing in workbook_close?
Best Regards
Eric
allocated variables.
I have a global variable of tyoe myObjectClasss, which I declare in the
module header like this:
Option Explicit
dim myObject as myObjectClass
I have made a sub updateMyObject which looks like this
Sub updateMyObject(a as integer)
If myObject = Nothing Then
set myObject = new myObjectClass
end if
myObject.initialize(a)
end Sub
I then have a lot of subs and functions that use myObject. It seems to
work fine.
However, Excel always crash when I shut it down. I am slightly worried
that it is because I never free myObject.
Would it be better if I set the variable in workbook_open and set it to
nothing in workbook_close?
Best Regards
Eric