Lurch68b

==> Variable must be of type "Object".:

5 posts in this topic

I hope one day to know what I am doing with this stuff. I have looked all over and while there are others who have had this issue I can't seem to fit it in with what I am seeing. Maybe I am thick? 

C:\Users\Administrator\Desktop\wcmdtool64\FanController.au3 (247) : ==> Variable must be of type "Object".:
For $line in $LabelArray
For $line in $LabelArray^ ERROR

What does this mean? I have trying to figure this out for a couple days now.

FanController.au3

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Sounds like $LabelArray isn't populated before your for loop occurs.  You might want to put a conditional check before processing the for loop.

 

If UBound($LabelArray) Then

       For $line in $LabelArray.....

       ....

       Next

EndIf

Edited by spudw2k

Share this post


Link to post
Share on other sites

Can you please post the full code? It's easier to help you solve your problem.


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

If it's a com object:

If IsObj($LabelArray) Then

       For $line in $LabelArray.....

       ....

       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

According to your code it should be an array but it isn't at that moment.
So you should check:

If IsArray($LabelArray) Then

       For $line in $LabelArray.....

       ....

       Next

EndIf

 


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

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