Problem with VBScript CreateObject?

I have created an Activex object and registered it on the the desktop. I have noticed that in VBScript CreateObject works fine without any problem.

However, I have noticed that if the browser (IE in this case) is not closed the object OCX file cannot be deleted and unregistered. I thought in VBScript it is sufficient to set the object to "nothing" to release it? Or is there more I have to do to "unload" the object?

Here's my code please tell me what I'm doing wrong here:

---------- CODE STARTS HERE ----------
<script language="VBscript">
Function isObjectValid()
on error resume next
Set TestObject= CreateObject("TestObject.MyObject")
isObjectValid= IsObject(TestObject)
Set TestObject= nothing
End Function
</script>

<SCRIPT LANGUAGE="JavaScript" FOR="window" EVENT="onLoad()">
if (isObjectValid())
document.write(" Valid object!");
else
document.write(" Not valid!");
</SCRIPT>
---------- CODE ENDS ----------
[1073 byte] By [darbien] at [2007-11-20 0:03:27]
# 1 Re: Problem with VBScript CreateObject?
Setting an object to nothing should be sufficient in this case. Strange as to why it doesn't work.

What I don't understand is your <script> line. FOR and EVENT are not valid attributes for a <script> tag.

<SCRIPT LANGUAGE="JavaScript" FOR="window" EVENT="onLoad()">
PeejAvery at 2007-11-8 0:40:40 >