0

why would this work?

echipe = meci2.getElementsByClassName("col-md-3 equipo ng-binding").Item(0).innerText

but this will raise Run-time error 438:

echipe = meci2.getElementsByClassName("col-md-3 equipo ng-binding")
echipa1 = echipe.Item(0).innerText
3
  • 1
    What data type is meci2.getElementsByClassName("col-md-3 equipo ng-binding")? If it is an object, you haven't said Set echipe = meci2.getElementsByClassName("col-md-3 equipo ng-binding"). And what data type is echipe? (Assigning a reference to an object into a variable is different to assigning a value into a variable.) Commented Sep 14, 2017 at 22:32
  • @YowE3K it was an object and you solved my dilemma, thank you. Commented Sep 14, 2017 at 22:42
  • @YowE3K please post an answer so i can accept it Commented Sep 24, 2017 at 10:45

2 Answers 2

1

In the statement

echipe = meci2.getElementsByClassName("col-md-3 equipo ng-binding").Item(0).innerText

it appears that you have declared echipe to be a String and that is valid syntax for assigning a value to a String variable. (Or perhaps you didn't declare what type echipe was, and therefore it has defaulted to a Variant, and therefore assigning a String value has forced it to be Variant/String.)


However, in the statement

echipe = meci2.getElementsByClassName("col-md-3 equipo ng-binding")

it appears that you have declared echipe to be some sort of object, or perhaps even the very generic type Object. The correct syntax for assigning a reference to an object to a variable is Set variable = object so, in your case, you needed

Set echipe = meci2.getElementsByClassName("col-md-3 equipo ng-binding")
Sign up to request clarification or add additional context in comments.

Comments

0

sorry but it's been a long time since i did this... i could be wrong but i think this would be correct:

echipe = meci2.getElementsByClassName("col-md-3 equipo ng-binding").Item(0)

echipa1 = echipe.innerText

sorry if i'm wrong... good luck!

1 Comment

Your use of echipe.innerText implies that echipe is an object, so it will still need a Set echipe = ....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.