Function
get2DArrayFromTableConten()
As
Variant
Dim
vRet()
As
Variant
Dim
htmlDOC
As
New
MSHTML.HTMLDocument
Dim
htmlTbl
As
MSHTML.IHTMLTable
Dim
htmlTblRow
As
MSHTML.IHTMLTableRow
Dim
htmlTblCell
As
MSHTML.IHTMLTableCell
Dim
lRow
As
Long
: lRow = 1
Dim
lCol
As
Long
: lCol = 1
htmlDOC.Body.innerHTML = ActiveInspector.CurrentItem.HTMLBody
Set
htmlTbl = htmlDOC.all.tags(
"table"
).Item(0)
ReDim
vRet(1
To
htmlTbl.Rows.Length, 1
To
5)
For
Each
htmlTblRow
In
htmlTbl.Rows
For
Each
htmlTblCell
In
htmlTblRow.Cells
vRet(lRow, lCol) = htmlTblCell.innerText
lCol = lCol + 1
Next
lCol = 1: lRow = lRow + 1
Next
get2DArrayFromTableConten = vRet
End
Function
Sub
main()
Dim
vRet
As
Variant
vRet = get2DArrayFromTableConten
End
Sub