scanner96

errot variable must be type object

5 posts in this topic

Hi

 

I have this script. Always get the error variable  muste br type Object. Where is the ERROR?

#include <IE.au3>
#include <MsgBoxConstants.au3>
Local $i = 0

Local $oIE = _IECreate("http://www.....")

do

    Local $sHTML  = _IEBodyReadHTML ($oIE)
If StringInStr ($sHTML, "Alira") or StringInStr ($sHTML, "Meli") then
_IELinkClickByText($oIE, "10",0,1)
else
_IELinkClickByText($oIE, "1",0,1)
endif
Until $i = 9

 

thanks

Arne

 

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!
The error is caused by you not posting the full error message you get. You call _IE* functions multiple times. How should we guess which one fails ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

BTW:
When you post code, please use code tags (the icon marked "<>" in the editor). So we get syntax highlighting and the code is much easier to read :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Try like this:

#include <IE.au3>

Local $oIE = _IECreate("http://www..........")
If Not IsObj($oIE) Then Exit MsgBox(48, "", "_IECreate() Error", 3)
Local $i = 0
Do
    $i += 1
    Local $sHTML = _IEBodyReadHTML($oIE)
    If @error Then ContinueLoop
    If StringInStr($sHTML, "Alira") Or StringInStr($sHTML, "Meli") Then
        _IELinkClickByText($oIE, "10", 0, 1)
    Else
        _IELinkClickByText($oIE, "1", 0, 1)
    EndIf
Until $i = 9

_IEQuit($oIE)

 


Regards,
 

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