Sign in to follow this  
Followers 0
Queener

Variable must be of type 'Object'

8 posts in this topic

Func Start();click on the span drop-down-menu

Local $sMyString = "Logs"
Local $sMyString2 = "ESD"
Local $oLinks = _IELinkGetCollection($oIE)

For $oLink In $oLinks
    Local $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
        _IEAction($oLink, "click")
    Second()
    EndIf
 Next
 EndFunc

 

Can someone point me to the right direction why I'm getting:

"C:\Users\aq\Desktop\Vision.au3" (22) : ==> Variable must be of type "Object".:
For $oLink In $oLinks
For $oLink In $oLinks^ ERROR

 


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites

You can do error handling.  What other error data is ouputed?

If IsObj($oLinks) Then
    For $oLink In $oLinks
        Local $sLinkText = _IEPropertyGet($oLink, "innerText")
        If StringInStr($sLinkText, $sMyString) Then
            _IEAction($oLink, "click")
        Second()
        EndIf
    Next
EndIf

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

jdelaney,

thats the only error I'm getting. By using your code; I receive no error, but it also doesn't run the next function which is second(). Second function is to delete the xls file.

 Func Second() ;delete xls file and go to next function

if FileExists($loc & "\*.xls") Then
FileDelete($loc & "\*.xls")
sitepress
Else
    sitepress
EndIf
EndFunc

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

There are either no links on your page, or they are inside frames.

Or, maybe you are referencing the wrong $oIE.

Or, maybe the page hasn't fully loaded...maybe loop until there is a collection.

Not enough information, you have to provide more.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

talk too soon.

--> IE.au3 T3.0-1 Error from function _IELoadWait, $_IEStatus_InvalidObjectType ()


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites

Seems to be an issue with your $oIE, then.

Since you didn't post how you created/attached, or attempted to do so, we can only guess....see post #5 again.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Global $sURL = "http://vision/index.aspx"
Global $oIE = _IECreate($sURL, 0, 1, 1, 1)

this is what I have. It's our cooperate intranet site so you guys won't be able to access it.

 

EDIT:

Strange, If i'm outside of the domain, it works fine. But if I joined domain, I get that error.

New EDIT: Found my own answer... For some odd reason, it required to run as Admin.

Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

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
Sign in to follow this  
Followers 0