WebRecorder "Exception EOleException" error

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
GerryB
Newbie
Posts: 7
Joined: Tue Jul 18, 2006 8:29 am

WebRecorder "Exception EOleException" error

Post by GerryB » Sun Jul 23, 2006 5:03 am

I am receiving the Application Error "Exception EOleException in module IEAuto.dll at 5CEEC." error unpredictibly in one part of my macro, and with 100% reproduction in another.

The issue seems to stem from using the WaitNewIE function and macro scheduler not recognizing the new window, or sending data to the window before it is ready.

In the first case the error is only occuring about 1% of the time on the command
libFunc>hIE,WaitNewIE,IE[1],0
being as it only occurs a small percentage of the time, I feel it is some type of timing issue, or perhaps IEAuto.dll somehow loosing that window instance..

In the second case where I can reproduce the error without fail, I know the window is open by the time that command is issued, as I put a several second delay and see the window open before the command executes.
it always fails at line:

Code: Select all

libFunc>hIE,WaitNewIE,IE[2],0
If I comment out the WaitNewIE line and try to send this line

Code: Select all

LibFunc>hIE,ClickTag,r,%IE[2]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue
I get a window box stating "N not appropriate"

I would post my code so it could be run, but the website I am recording requires password protection..

Has anyone else seen this issue, or can you reproduce it? If you put the lines

Code: Select all

libFunc>hIE,WaitNewIE,IE[1],0
libFunc>hIE,WaitIE,r,IE[1]
somewhere that a new window is not opening, it should crash your macro scheduler. For some reason it does not produce the same OleException error I receive, but it will crash macro scheduler all the same (on my system at least)

Thank you for any assistance you can provide.

Gerry

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Jul 23, 2006 8:05 am

There are no known issues with WaitNewIE. We use it regularly. Those lines on their own are not sufficient to tell us what the problem is. We need to see the rest of the script. Don't worry that the script can not be run. Just blank out your passwords etc.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

GerryB
Newbie
Posts: 7
Joined: Tue Jul 18, 2006 8:29 am

Post by GerryB » Sun Jul 23, 2006 8:16 am

Here is the script. I have placed "//crashes here" in the two locations that the script crashes with the noted error for me. I can place the line "libFunc>hIE,WaitNewIE,IE[2],0" anywhere in my code to cause macro scheduler to crash (after hitting the stop button the client will abnormally exit, but will not provide the OLEexception error gump)

Thank you for looking into this,
Gerry

Code: Select all

Let>RFS_Variable=98997
Let>username=
Let>password=

// Generated by MacroScript WebRecorder 1.70
// Recorded on Tuesday, July 11, 2006, at 03:49 AM
LibLoad>IEAuto.dll,hIE
If>hIE=0
  MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
  Goto>end_script
EndIf

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1

LibFunc>hIE,CreateIE,IE[0],0
//LibFunc>hIE,ShowIE,r,%IE[0]%,0

LibFunc>hIE,Navigate,r,%IE[0]%,https://isftools.ahf.nmci.navy.mil/
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={"login"}
Let>FieldName={"user"}
Let>FieldValue={"%username%"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

Let>FrameName={""}
Let>FormName={"login"}
Let>FieldName={"password"}
Let>FieldValue={"%password%"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

Let>FrameName={""}
Let>FormName={"login"}
Let>TagValue={"loginSubmit"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={"pickRole"}
Let>FieldName={"role"}
Let>FieldValue={"SSE-Base Ops"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

Let>FrameName={""}
Let>FormName={"pickRole"}
Let>TagValue={""}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={"pickRole"}
Let>TagValue={"APPLICATION DATA"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={"pickRole"}
Let>TagValue={"Application Catalog"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay


Let>FrameName={""}
Let>FormName={"searchForm"}
Let>FieldName={"rfsId"}
Let>FieldValue={"%RFS_Variable%"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

Let>FrameName={""}
Let>FormName={"searchForm"}
Let>TagValue={"viewList"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>A18_SIZE=4098
LibFunc>hIE,ExtractTag,r,%IE[0]%,,A,18,0,A18
MidStr>r_6,1,r,A18
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:%A18%

libFunc>hIE,WaitNewIE,IE[1],0
//sometimes crashes here
libFunc>hIE,WaitIE,r,IE[1]
wait>delay
WaitWindowOpen>Application Usage*
wait>delay
WaitReady>Application Usage*
wait>delay


Let>TD_VALUE=14
Label>FindUICLoop
  Let>RFS_String=%RFS_Variable% %CRLF%RFS Notes 
  Let>TD_VALUE=TD_VALUE+1
  if>TD_VALUE=15
  //check to make sure UIC is found in this table
  Let>CELL_SIZE=4098
  LibFunc>hIE,ExtractTag,r,%IE[1]%,,TD,TD_VALUE,0,UIC_CELL
  MidStr>r_6,1,r,UIC_CELL
  //messagemodal>%UIC_CELL%
      if>%UIC_CELL%<>UIC
      messagemodal>UIC cell not in proper location, script aborting
	  goto>abort
      endif
  endif
  //Modify buffer size if required ...
  Let>CELL_SIZE=4098
  LibFunc>hIE,ExtractTag,r,%IE[1]%,,TD,TD_VALUE,0,RFS_CELL
  MidStr>r_6,1,r,RFS_CELL
//  messagemodal>%TD_VALUE% is TD_Value - rfscell set to %RFS_CELL%
  If>%RFS_CELL%=%RFS_String%,FoundFirstUIC
  Goto>FindUICLoop
Label>FoundFirstUIC
  //subtract 5 spaces from RFS location
  let>Site_UIC=TD_VALUE-5
  Let>CELL_SIZE=4098
  LibFunc>hIE,ExtractTag,r,%IE[1]%,,TD,Site_UIC,0,Site_UIC_INFO
  MidStr>r_6,1,r,Site_UIC_INFO
//messagemodal>the Site_UIC variable is %Site_UIC% the text is %SITE_UIC_INFO%
wait>delay

LibFunc>hIE,KillIE,r,%IE[1]%

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={"pickRole"}
Let>TagValue={"REPORTS"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
//Let>FormName={"pickRole"}
Let>FormName={"searchForm"}
Let>TagValue={"Application Deployment Solution "}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay


Let>FrameName={""}
Let>FormName={"searchForm"}
Let>TagValue={"Search for Command"}
LibFunc>hIE,ClickTag,r,0,str:FrameName,str:FormName,A,TEXT,str:TagValue


//libFunc>hIE,WaitNewIE,IE[2],0
//crashes here -- on above line when uncommented
//script not functional fro mthis point on
//libFunc>hIE,WaitIE,r,IE[2]

//LibFunc>hIE,WaitIE,r,%IE[2]%
//wait>delay

WaitWindowOpen>Command Search*
wait>delay
WaitReady>Command Search*
wait>delay
SetFocus>Command Search*

Let>FrameName={""}
Let>FormName={"search"}
Let>FieldName={"uic"}
Let>FieldValue={"%Site_UIC_INFO%"}
LibFunc>hIE,FormFill,r,%IE[2]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
//LibFunc>hIE,FormFill,r,%IE[2]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

//LibFunc>hIE,WaitIE,r,%IE[2]%
//Wait>delay

Let>FrameName={""}
Let>FormName={"search"}
Let>TagValue={"submit"}
LibFunc>hIE,ClickTag,r,%IE[2]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

//LibFunc>hIE,WaitIE,r,%IE[2]%
//Wait>delay



//messagemodal>done

Label>abort
//exited with error
WriteLn>c:\DAAreportscript.log,result,DAAaborted for %RFS_Variable%


User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Jul 23, 2006 9:23 am

There's a potential problem with the line BEFORE your WaitNewIE call:

LibFunc>hIE,ClickTag,r,0,str:FrameName,str:FormName,A,TEXT,str:TagValue

This line has zero in place of the IE instance identifier. The line should be:

LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

But since IE[0] is likely to be 0 here anyway it's probably fine. But I would change it anyway.

I want to try to ascertain wether the problem you are having is something to do with your PC or Internet Explorer setup, or with this particular website. So out of interest can you try running the following script and tell me if it works. It goes to wotnot.com and clicks the WhoIs link to open a new IE window and pulls up the whois details for mjtnet.co.uk:

Code: Select all

// Generated by MacroScript WebRecorder 1.70
// Recorded on Sunday, July 23, 2006, at 08:55 AM
LibLoad>IEAuto.dll,hIE
If>hIE=0
  MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
  Goto>end_script
EndIf

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1

LibFunc>hIE,CreateIE,IE[0],0

LibFunc>hIE,Navigate,r,%IE[0]%,www.wotnot.com
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"whois system"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

libFunc>hIE,WaitNewIE,IE[1],0
libFunc>hIE,WaitIE,r,IE[1]

LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

Let>FrameName={"in"}
Let>FormName={""}
Let>FieldName={"domain"}
Let>FieldValue={"mjtnet"}
LibFunc>hIE,FormFill,r,%IE[1]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

Let>FrameName={"in"}
Let>FormName={""}
Let>TagValue={"Submit"}
LibFunc>hIE,ClickTag,r,%IE[1]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

LibFree>hIE
Label>end_script
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

GerryB
Newbie
Posts: 7
Joined: Tue Jul 18, 2006 8:29 am

Post by GerryB » Sun Jul 23, 2006 9:44 am

Your sample script works like a charm.

I have found another issue with this window that WaitNewIE hangs on, when in the webrecorder application after clicking on the results of my search, the window automatically closes itself (normal behavior for the website.. it autofills a field on the parent IE window when it closes) and the webrecorder produces the error "Could not obtain the OLE control window handle." I assume since it can no longer fidn a window it expects to see. Not sure if this will be a problem for the actual macro when it is in macro scheduler, or if it is just within the webrecorder utility.

Thank you for your support in this.

Gerry

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Jul 23, 2006 9:52 am

So there is something about your new IE window. In order to determine whether or not there is anything we can do about it (there may not be) I would need to see it. Without seeing this window I can't do very much.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts