
You could always assign an event handler to the window.onunload or onbeforeunload event using the GetRef() function.

2) Use a 3rd party component like ScriptX which has (in its free no-license-required subset) a method that is roughly equivalent to the WScript.ConnectObject method). When the IE instance is closed, the WSC instance is effectively invalid for further use. The downside is that the IE instance is statically bound to the WSC instance. I know of only 2 ways: 1) use the element. Check the documentation for details Wrapping an IE instance in a WSC instance and sinking the IE events is difficult to do. The 2nd argument of the VBScript form of CreateObject does not have the same purpose as the 2nd argument of the WScript form of CreateObject. Can the IE CreateObject command contain two parameters in a WSC scriptlet? If not, how would one best detect a click on the close button? Regards, Andy - ********** Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com ********** Michael harris 23:54:23.

The following code works without a problem: Set oIE = CreateObject(“InternetExplorer.Application”) However, the following code results in a “80040111” WSH error (“Could not create object named scriptlet_name_here”): Set oIE = CreateObject(“InternetExplorer.Application”,”ie_”) Without being able to connect to the IE object, I don’t know how to trap closing the IE window after clicking on the close button, which would otherwise fire an IE_onquit subroutine.

I’m trying to instantiate IE in a WSC scriptlet using VBS 5.6 under W2K SP4 and IE 5.5. Microsoft W2ksp4 En Exercice Rating: 5,9/10 4831votes
