1

I have this code below from HTML document, result of inspection object from site web.
I want to get the object <input name="username" value=""> with VBA Excel code.

<tr id="username_block"> 
    <td class="shade" width="50%" align="right"> 
        <div align="left">Nom d’utilisateur:</div>
    </td>
    <td class="shade" width="50%"> 
        <input name="username" value="">
    </td>
</tr>

I use this instruction

set element=oIe.Document.getElementsById("username_block")

but no results (element=nothing).

3
  • Can you expand on your code? What is ole and where is it defined? Commented Dec 27, 2022 at 10:54
  • Did you wait for the page to load before doing that? Commented Dec 27, 2022 at 11:24
  • the object id="username_block" and name="username" Commented Dec 27, 2022 at 16:56

1 Answer 1

2

Isn't the method's name getElementById, without "s"?

Sign up to request clarification or add additional context in comments.

1 Comment

It is. And this is most probably the issue here. Well spotted. :)

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.