Results 1 to 4 of 4

Thread: [RESOLVED] ON VBA for excel... how to click on wen page button with red circle

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,580

    Resolved [RESOLVED] ON VBA for excel... how to click on wen page button with red circle

    i need to simulate a click event on button wìth red circle. ?

    image attached.

    i use the tipical IE:

    ....
    Set IE = CreateObject("InternetExplorer.Application")

    With IE

    URL = ""

    IE.Navigate URL
    IE.Visible = True

    Do While IE.Busy: DoEvents: Loop
    Do
    DoEvents
    Loop Until IE.ReadyState = READYSTATE_COMPLETE
    end with
    Last edited by luca90; Jan 21st, 2022 at 02:07 AM.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: ON VBA for excel... how to click on wen page button with red circle

    try like
    Code:
    For Each ele In ie.Document.getelementsbytagname("a")
        If InStr(ele.outerhtml, "title=""Prossimo""") Then Exit For
    Next
    ele.Click
    seems to work ok, at least in the short term
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,580

    Re: ON VBA for excel... how to click on wen page button with red circle

    Quote Originally Posted by westconn1 View Post
    try like
    Code:
    For Each ele In ie.Document.getelementsbytagname("a")
        If InStr(ele.outerhtml, "title=""Prossimo""") Then Exit For
    Next
    ele.Click
    seems to work ok, at least in the short term
    GREAT! Tks bro
    Work

    have idea to get data from the table: Profilo Iscritto Albo

    [ur

    sorry but not a good experience with DOM
    Last edited by luca90; Jan 23rd, 2022 at 11:22 AM.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [RESOLVED] ON VBA for excel... how to click on wen page button with red circle

    try like
    Code:
    Set ele = ie.Document.getelementbyid("pdb-main")
    For Each dl In ele.getelementsbytagname("dl")
        Debug.Print dl.Children(0).innertext;
        Debug.Print vbTab;
        Debug.Print dl.Children(1).innertext
    Next
    but you really need to learn to do some of this for yourself
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width