Jump to content
Sign in to follow this  

Help with COM error 80020009

Recommended Posts

Hello everyone,

I am writing a program that opens Internet Explorer then does manipulations from there. I keep getting a COM error with these details. The error is occurring on a compiled .exe version of the script, but not in the Scite debugging when you press "Go".

err.description is:


err.number is: 80020009

err.lastdllerror is: 0

err.scriptline is: -1

err.source is:

err.helpfile is:

err.helpcontext is: 0

Here is the error catch I am using and the problematic code.

COM error catch:

#include <Excel.au3>
#include <File.au3>
#include <Array.au3>
#include <IE.au3> 
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <DateTimeConstants.au3>
#include <WinAPI.au3>
#include <Timers.au3>
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")    ; Initialize a COM error handler
; This is my custom defined error handler
Func MyErrFunc()
  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"    & @CRLF  & @CRLF & _
             "err.description is: " & @TAB & $oMyError.description  & @CRLF & _
             "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "       & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _
             "err.source is: "       & @TAB & $oMyError.source       & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile     & @CRLF & _
             "err.helpcontext is: " & @TAB & $oMyError.helpcontext _

Where error is occurring (I did some troubleshooting and narrowed it down to these three lines):

;opening and manipulating IE
Global $oIE = _IECreate("https://login.advancedmd.com/")
WinWaitActive("AdvancedMD – Client Login - Windows Internet Explorer")
WinSetState("AdvancedMD – Client Login - Windows Internet Explorer", " ", @SW_MAXIMIZE)

Basically when the script runs it opens Internet explorer to the correct site, it then throws the COM error message box. Then if I click "Okay" on the COM error message box it will then proceed to maximize the window and perform the rest of the script correctly. I tried it without the COM error catch (maybe it was a false positive situation) and I still received an "autoit object" error from windows. I also threw and "Exit" prior to IE opening and did not receive an error prior to exiting. So I am pretty sure this is the culprit.

Any help would be great! I am at the point where I would like to put this .exe on some other computers and this is hindering that step.

Thank you everyone!


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...