shoaibkadri
New Member
- Joined
- Jul 13, 2011
- Messages
- 2
Hello all,I am struck in my code....
The scenerio is like this there are multiple tables in my web page. Each table has 7 column the 2 column is a check box while the 3 column is a radio button.Now i need the value of one such table on excel sheet.
I have done till here but the problem is i am unable to pull the value of the radio button n checkbox.
Is there anyway i can traverse in the html within the table :S
the code to pull table data follows:
Set mDocument = ie.Document
For Each element In mDocument.all 'search all the elements of the web page
If InStr(1, element.tagName, "TABLE") > 0 Then
Set tbl = element
If tbl.ID = "xyz" Then
For x = 0 To tbl.Rows.Length - 1 ' Cycle through rows
Set tr = tbl.Rows(x)
For y = 0 To tr.Cells.Length - 1 'Cycle through cells
Set tc = tr.Cells
Sheets("Sheet2").Cells(k, y + 1).Value = tc.innerText
Next y
k = k + 1
Next x
End If
End If
Next
Please help
The scenerio is like this there are multiple tables in my web page. Each table has 7 column the 2 column is a check box while the 3 column is a radio button.Now i need the value of one such table on excel sheet.
I have done till here but the problem is i am unable to pull the value of the radio button n checkbox.
Is there anyway i can traverse in the html within the table :S
the code to pull table data follows:
Set mDocument = ie.Document
For Each element In mDocument.all 'search all the elements of the web page
If InStr(1, element.tagName, "TABLE") > 0 Then
Set tbl = element
If tbl.ID = "xyz" Then
For x = 0 To tbl.Rows.Length - 1 ' Cycle through rows
Set tr = tbl.Rows(x)
For y = 0 To tr.Cells.Length - 1 'Cycle through cells
Set tc = tr.Cells
Sheets("Sheet2").Cells(k, y + 1).Value = tc.innerText
Next y
k = k + 1
Next x
End If
End If
Next
Please help
Last edited: