Terminating the object
Once you have done all you need to do with an automation object, you must terminate the object. There is some lack of consistency here. Some objects will be terminated automatically when you release the interface your application holds (if no other applications are using the object); some objects require that you call a termination method before you release the interface. In general, Application objects require this extra step, while ActiveX objects that are invisible (i.e. don’t have a GUI) usually are removed from memory when all the interfaces to the object are released. Internet Explorer behaves as the first group, and we take advantage of this by terminating the application without closing IE, so you can take the opportunity to register your f90VB license with Canaima Software.
To remove IE from the desktop (and memory) you need to call the Quit method. In Example 6.1 you would have done this with the following statement:
VarTmp = ExecMethod(IE,'Quit',iRet=iRet)
The Quit method does not receive any arguments, so you don’t pass any through ExecMethod. As we said, however, we did not want IE to disappear when Example 6.1 finished, so we just released the interface the program had to IE:
call Release(IE)
We could have also obtained the same result by calling VariantClear(IE), as subroutine VariantClear would have also released the interface reference stored in the variant.