Jump to content

errot variable must be type object


Recommended Posts

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

 

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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,
 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...