Jump to content

Consistently getting a Error from the IE.au3 UDF


RickB75
 Share

Recommended Posts

Guys,

I'm stumped....

I can't figure out why I keep getting this error:

C:Program FilesAutoIt3IncludeIE.au3 (561) : ==> The requested action with this object has failed.:
While Not (String($o_object.document.readyState) = "complete" Or $o_object.document.readyState = 4 Or $f_Abort)
While Not (String($o_object.document.readyState^ ERROR

Here's my code

$objIE = _IECreate($URL_Start & $VIN & $URL_Middle & $uid[$iCounter] & $URL_End, 0, 1, 0)
;Change Autoit to look at hidden text. To reset add "Default" as parameter.
Opt("WinDetectHiddenText", 1)
;Change Autoit to look for string in the page title. 
Opt("WinTitleMatchMode",2)
_IELoadWait($objIE)


If WinWaitActive("Object reference","Object reference") Then

_IEQuit($objIE)
ElseIf WinWaitActive($URL_Start & $VIN & "&Selecte - Windows Internet Explorer","AVUICommandWidget") Then

bla, bla bla

EndIf

normally my script runs fine but here recently some of the Url's that would be navigated to would have basicly have an error so I've got to put a check in the script so that if one of these pages gets displayed, then IEQuit and then loop through again.

I've changed and rewrote this thing multiple times and I'm still getting this error. I can't figure it out.

 

This snip sits inside a loop.

Link to comment
Share on other sites

Which command is causing the error to occur?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

ieloadwait  is causing the issue I think. If I change the parameters in IECreate to wait to return, I get the error or by putting ieloadwait in the script like above, I get an error. The problem I have is the URL's are links to PDF's so they will load at different speeds and sometimes the window loads / script returns before the PDF is fully loaded in the window. I just thought I could use a simple IF statement for the check and keep on rolling on with my script but that doesn't seem to be the case.I tried other versions of the script since the post and still running into errors.

Link to comment
Share on other sites

Here is a simple revised version snip of my script that you guys can see in action. Can one of you tell me why it is throwing errors?

#include <IE.au3>

    $objIE = _IECreate("http://www.beaman-auto.com/windowsticker/5TDYK3DC1ES458850.pdf")
    ;_IELoadWait($objIE)
    ;Change Autoit to look at hidden text. To reset add "Default" as parameter.
    Opt("WinDetectHiddenText", 1)
    Opt("WinTitleMatchMode",2)

    If WinActive("Object reference","Object reference") Then

        _IEQuit($objIE)

    Else


         WinWait("http://www.beaman-auto.com/windowsticker/5TDYK3DC1ES458850.pdf - Windows Internet Explorer","AVUICommandWidget")
        
         MsgBox(0,"stop","stop")

    EndIf
Link to comment
Share on other sites

Upgrade your version of AutoIt, because it doesn't have that error in 3.3.10.2 which is the latest version.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Ok, I upgraded my version of Autoit to most recent Public version (Non Beta). Here is the issue I kept running into. Using the wait parameter in _Iecreate, the script would not return and basically stall. So... I set it to return immediately and I placed

Do

Sleep(500)

Until   _IEPropertyGet($objIE,"statustext") = "Done"

 after the IECreate function and it seems to be running fine. This script is loading PDF's and some windows takes longer to load than others. I thought I could just use the IE wait parameter in IECreate but that's not the case. Have any of you other guys or girls :D experienced something similar? I'm using IE8. maybe that's the problem.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...