Jump to content

IE.au3 IsObj Error


 Share

Recommended Posts

I just started to try programming with Dale's IE.au3 and I was quickly forced to a halt.

Line 728 (File "C:\Documents and Settings\Oxin8\Desktop\IE.au3"):

If IsObj($o_object.document.forms.item ($s_name, $i_index)) Then

If IsObj($o_object^ ERROR

Error: Variable must be of type "Object".

I searched the forums and found close to nothing. _IEFormGetObjByName is where the problem lies.

Cut down script that produces the error:

#include <IE.au3>
$loginpage = "http://login.yahoo.com/config/login?.src=ym&.intl=us&.partner=&.done=http%3A%2F%2Fmail.yahoo.com%2F"
$ie = _IECreate()
_IENavigate($ie,$loginpage)
$myform = _IEFormGetObjByName($ie, "login_form")

I'm using the most recent beta(I checked multiple times). Thanks for the help.

Edited by Oxin8
Link to comment
Share on other sites

Have you tried any of the examples to see if they work for you? Is it specific to the URL you are using or does if fail no matter what you use? Also, check the output from AutoIt to insure that it shows that it is running the version you expect

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

this tested fine

Line 728 (File "C:\Documents and Settings\Oxin8\Desktop\IE.au3"):

the error occured as you do not have the IE.au3 File in the "Beta\Include" Folder

put the file there... thats it

however

If IsObj($o_object.document.forms.item ($s_name, $i_indes)) Then

If IsObj($o_object^ ERROR

i get sometimes... Occasionally

( hoping for the new release from Dale )

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

try running it

5 times ( due to the occasional error )

try putting a sleep in

#include <IE.au3>
$loginpage = "http://login.yahoo.com/config/login?.src=ym&.intl=us&.partner=&.done=http%3A%2F%2Fmail.yahoo.com%2F"
$ie = _IECreate()
_IENavigate($ie,$loginpage)
Sleep(3000)
$myform = _IEFormGetObjByName($ie, "login_form")

it worked for me... except the occasional error

8)

NEWHeader1.png

Link to comment
Share on other sites

I'm running the beta(110% positive.)

Same error with example script. (

Error: Variable must be of type "Object".

) but in a different line of the IE.au3

Putting it in the beta\include folder didn't help.

Maybe something wrong with the object?

Be 120% sure by adding a message box to show the @AutoItVersion macro value. I have come across times when AutoIt reverts back to it release version.

“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Link to comment
Share on other sites

there is an error in the function.... i dont know why... from copying... an older version.. dunno

but here it is

your error.. as i confirmed by you posting it twice....

If IsObj($o_object.document.forms.item ($s_name, $i_indes)) Then

If IsObj($o_object^ ERROR

and the actual function

Func _IEFormGetObjByName($o_object, $s_name, $i_index = 0)

; $o_object - IE object

; $s_name - name of form

; return object reference to specific form

If IsObj($o_object.document.forms.item ($s_name, $i_index)) Then

SetError(0)

Return $o_object.document.forms.item ($s_name, $i_index)

Else

SetError(1)

Return 0

EndIf

EndFunc ;==>_IEFormGetObjByName

it seemd you have indes ... not index

my suggestiojn

download a new copy

and get the IE au3 Builder ( really helpful )

http://www.autoitscript.com/forum/index.ph...68&hl=Valuater#

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I checked in hope that you were right but no... I just copy and pasted from my first post. It's "index" as it should be. I'll get the builder in hope that it might help somehow but as of now I still get the error.

copy and paste is very error-prone. Please right-click and save the file that way.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

copy and paste is very error-prone. Please right-click and save the file that way.

Dale

@Dale

I am not sure if you are aware that the IE.au3 Builder searches all over for the beta... if not found it prompts the user with a file open dialog...

after that... it searches for the IE.au3 Library in the beta directory.. if not found, it asks the user to download it

If Not FileExists($AutoItBetaLocation & "\Include\IE.au3") Then
    $iMsgBoxAnswer = MsgBox(262209, "IE.au3 Error #2", "IE.au3 Library is required   " & @CRLF & "Download from www.Autoit3.com ?  ")
    If $iMsgBoxAnswer = 1 Then
        $web_loc = "http://www.autoitscript.com/forum/index.php?showtopic=13398&hl=#"
        Run(@ComSpec & " /c Start " & $web_loc, "", @SW_HIDE)
        MsgBox(262208, "Web Site", "The IE.au3 Library is at the bottom of this page...    " & @CRLF & @CRLF & "Save as " & $AutoItBetaLocation & "\Include\IE.au3   ", 10)
        $Dwait = 1
    EndIf
;Exit
EndIf

that can help eliminate many errors in the beginning

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

@Dale

I am not sure if you are aware that the IE.au3 Builder searches all over for the beta... if not found it prompts the user with a file open dialog...

after that... it searches for the IE.au3 Library in the beta directory.. if not found, it asks the user to download it

Sweet!

Thanks

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Actually... because IE.au3 Library is so great

( dont get a big head now ... lol )

there are two pages in the Welcome to Autoit describing IE.au3 ... one page is full of functional demos from your page three and more...

user only needs to click to run the demo

( thought you might want to know )

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I tried this earlier, and was going to post then, but decided against it because I didn't really have anything important to say. But, now I haven't gotten anywhere and I'm still going to post....

Anyway, when I tried it, I only got the error twice (out of more than 30 or 40 tries). I really don't know what would cause it, because it looked the same (at least on the surface) each time it worked right and each time it didn't.

I guess the only thing I could suggest is adding some sleeps in there to see if it has to do with a timing issue, or maybe.. doing it in firefox and looking at the page info and page source manually to see if anything is noticeably wrong. If I remember correctly, I got the error once when I switched the code from _IECreate(1) back to _IECreate(), so maybe adding the 1 to make sure it is visible and doesn't rely on the optional parameter would do something? Sounds like it shouldn't, but it's always worth a try.

Good luck with that issue.

Link to comment
Share on other sites

@greenmachine

there is what has in the past been a very obscure and elusive timing issue. For some reason it have seen more reports recently and I have posted some test code that I hope will address the issue - please find it here and help with testing.

ummm... I feel like an idiot. The create fails... What's that mean I'm missing? I have internet explorer and it works....

You showed error messages that indicated a corrupt IE.au3 - if you are still getting the same error then you still have a corrupt IE.au3

If you are having a different problem now you need to post new information and error messages.

Dale

Edit: added message to greenmachine

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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...