Link to home
Start Free TrialLog in
Avatar of Ragala Santosh Kumar
Ragala Santosh Kumar

asked on

How to take the table data from a pop up in a website using VBA

Hi,
I am not able to navigate to the Form or Pop up which will be displayed after clicking on a button in website. When I search for the table with table ID; it is searching only for the IDs which are present in the website main page and not on the pop up which is displayed on the screenshot.
Can someone please me help me out how to take the data which is present in the pop up.
Thank you in advance.



   
      'above some code is presrnt.
      'I am clicking on the button which will open a POP up
      HTMLDoc.getElementById("ctlClaimTabControl_tabClaimExceptions_lnkButton").Click
   
      HTMLDoc=browser.document

    'my code
   
     Dim HTMLTables As IHTMLElementCollection
     Dim HTMLTable As IHTMLElement
     Dim HTMLRow As IHTMLElement
     Dim HTMLCell As IHTMLElement
       
       
     Set HTMLTables = HTMLDoc.getElementsByTagName("table")
     
     i = 1
     For Each HTMLTable In HTMLTables
     Worksheets.Add
     
     If HTMLTable.ID = "ctl02_grdExceptions" Then
     
    ' Range("A" & i).Value = HTMLTable.className
     'Range("C" & i).Value = HTMLTable.ID
     'Range("D" & i).Value = HTMLTable.innerText
     'Range("B" & i).Value = Now
     Rownum = 2
     
     'If HTMLTable.ID = "grdNotes" Then
     
     
     For Each HTMLRow In HTMLTable.getElementsByTagName("tr")
     
     'Debug.Print HTMLTable.innerText
       
        ColNum = 1
            For Each HTMLCell In HTMLRow.Children
                Cells(Rownum, ColNum) = HTMLCell.innerText
                ColNum = ColNum + 1
             Next HTMLCell
         Rownum = Rownum + 1
      Next HTMLRow
     'End If
     i = i + 1
     End If
     
    Next HTMLTable
Avatar of Rgonzo1971
Rgonzo1971

Avatar of Ragala Santosh Kumar

ASKER

Hi,
Thank you for your response.

I am not getting the solution.
My pop up window title is
"Loan Sphere Invoicing - comment" but debug displaying only two window names
1)File Explorer
2) Internet Explorer

I have attached my website which I am using.
What should I do now? Please help me.
comm.PNG
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.