Automation error using CreateObject("InternetExplorer.Application")

I'm using the following code in VBA:

    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")

I've also tried:

    Dim IE As Object
    Set IE = New InternetExplorerMedium

I always finish with:

    IE.Quit
    Set IE = Nothing

But I randomly get an "Automation Error" (usually is fine except for about 1 quarter of the time):

Run-time error '-2147023706 (8000704a6)':

Automation error
A system shutdown has already been scheduled.


Seems like IE is not closing properly sometimes.
intoxicated_curveballAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaauCommented:
I know, it is logical to call IE.Quit, however, it is undocumented. You will argue that the method exists, and it is even in their sample on the very page I have referred to, but maybe it is not documented for a reason. What happens if you just do not call it? Just call  Set IE = Nothing and get the garbage collector to take care of disposing the object
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big MontyWeb Ninja at largeCommented:
silly question, but have you rebooted since getting the error?
0
intoxicated_curveballAuthor Commented:
Rebooting or waiting a few minutes seems to always work. But I'm using this frequently so that's only a temp solution. Seems to have something to do with the object or process still running enough though it shouldn't be?
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
chaau: Quit() is documented, but on a different page: https://msdn.microsoft.com/en-us/library/ms970456.aspx.

intoxicated_curveball, the object might be busy, so check for IE.Busy prior to trying to quit, or call IE.Stop.
Do you have to use IE, or might the WebClient class serve the same purpose better? It doesn't require to perform all the rendering needed by IE for visual presentation.
0
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.