0

The page loads fine, and the submit button at the bottom gets invoked fine (buttom.Click), but how do I grab the two tables marked in screenshot (see arrows)?

Option Explicit
Private Sub CommandButton1_Click()
 Dim buttom As MSHTML.HTMLInputElement
 Dim table1 As MSHTML.HTMLInputElement
  Dim i As SHDocVw.InternetExplorer
  Set i = New InternetExplorer
  i.Visible = True
  i.navigate ("http://10.236.244.10/summary.php")
  
  Do While i.readyState <> READYSTATE_COMPLETE
  
  Loop
  Dim idoc As MSHTML.HTMLDocument
  Set idoc = i.document
  idoc.getElementsByName("start_date").Item.Value = "2020/12/15 00:00:00"
  idoc.getElementsByName("end_date").Item.Value = "2020/12/15 23:59:59"
  Application.Wait Now() + TimeValue("00:00:01")
     idoc.getElementsByTagName("select").Item.Value = "45"
     Set buttom = idoc.getElementsByName("submit")(0)
     buttom.Click

  Do While i.readyState <> READYSTATE_COMPLETE 
  Loop

'''''' Probably some code needs to go here?????      

End Sub

enter image description here

  • You don't appear to have tried to select the tables in your code? From the other tabs open in your screenshot it looks like you may have been doing some reading. What did you try? And what didn't work? – QHarr Dec 16 '20 at 22:31
  • hi QHarr i have try a lot of way to copy table from this page but don't work i just need to copy this tables using VBA – Ebram Shehata Dec 17 '20 at 09:47
  • Dim tables As Object: Set tables = ie.document.querySelectorAll("#datatable") then loop .from 0 to tables.Length - 1 and write out tables to next free row e.g. https://stackoverflow.com/a/53556545/6241235 – QHarr Dec 17 '20 at 13:28
  • Did that help to resolve? – QHarr Dec 18 '20 at 18:16
  • I will try it when I go work next Sunday because it is a local website – Ebram Shehata Dec 18 '20 at 21:08
  • Ah.. no worries. Speak then :-) – QHarr Dec 18 '20 at 21:32

0 Answers0