+ Reply to Thread
Results 1 to 7 of 7

getElementBYID not working

  1. #1
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    285

    getElementBYID not working

    Hi Guys,

    Attached is a code that I used to use in another project but now that I am trying to use it in a new project this code is not working " WebBrowser.Document.getElementByID("ctl00_ContentPlaceHolder1_HyperLink1").Click"

    I upload files everyday, attached are also the instructions and files that I upload. Hopefully someone can give me a hand with that is wrong in my code.

    In the code is a temporary password and my user id.
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: getElementBYID not working

    Have you tried adding reference to MS HTML object library?

    Also for waiting while IE load, try something like...
    Please Login or Register  to view this content.
    In 90% of case, one or the other is enough, but in some instances, you'll need to check for both.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: getElementBYID not working

    If the code is for different site, have you checked if the page source has the same element as the old one?

    WebBrowser.Document.getElementByID("ctrlLoginLdap1_lnkLogin").Click

    ?
    You need to check if element ctrlLoginLdap1_lnkLogin exist on the page.

  4. #4
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    285

    Re: getElementBYID not working

    I will give it a try and advise. Thanks

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: getElementBYID not working

    How does the code not work?
    If posting code please use code tags, see here.

  6. #6
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    285

    Re: getElementBYID not working

    I must click on a button that says in spanish Deliver Invoice (Envío) and this code should do that but it does not "WebBrowser.Document.getElementByID("ctl00_ContentPlaceHolder1_HyperLink1").Click"

    Have you tried it?

  7. #7
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    285

    Re: getElementBYID not working

    CK76, what would be that code for MS HTML object library? Could you please advise?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IE.Document.getElementById("ID") not working!
    By excel_drives_crazy in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-11-2018, 10:16 AM
  2. Unable to get the getElementById from a webpage
    By Yash20 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-19-2016, 09:51 AM
  3. getElementByID with duplicate IDs in the webpage
    By vincenzo345 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2015, 11:32 PM
  4. getelementbyid with duplicate ID's on Page
    By manofcheese in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-31-2015, 09:16 PM
  5. getElementById run-time 13 type mismatch error
    By killerkoz17 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2014, 10:41 PM
  6. IE.document.getElementByID returns run-time error '91'
    By matt100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2013, 09:32 PM
  7. problem extracting data from webpage using getelementbyid
    By mwalshe99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2012, 08:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1