I'm running an Excel VBA macro which opens a IE instance, extracts data from a URL and then is supposed to close the instance again.
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
Set IE = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
' Do stuff...
' Clean up
IE.Quit
Set IE = Nothing
I looked up that method and it is supposed to close the IE instance. However that does not work for me.
The task manager confirms that the iexplorer.exe
process is still running. If I run the macro several times a new instance is added and never closed.
How can I make the macro properly close the instance?
I'm using IE 8.0 and VBA 7.0 on this.
As @Sorceri statet correct in the comments, I have created two instances. The following Code quits the instance without problems.
Dim IE As Object
Set IE = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
' Do stuff...
' Clean up
IE.Quit
Set IE = Nothing
Interesting about the above (wrong) code is, that he indeed opens 2 instances, but does not close either of them at the end.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With