Hello! This has been stumping me for about a week now. I'm attempting to create a spreadsheet that can pull the table data from HP's Network Node Manager automatically based off the MAC address populated in the field. The script is now able to load the correct page but I'm getting the above error on:
aTD = Doc.getElementsByTagName("td")(0).innerText
Below is the entire script.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = Range("MAC_Address").Row And _
Target.Column = Range("MAC_Address").Column Then
Dim IE As New InternetExplorer
IE.Visible = True
IE.navigate "https://nnm/nnm/protected/switchportresults.jsp?endNodeName=" & Range("MAC_Address").Value
Do
DoEvents
Loop While IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.Container
Dim aTD As String
aTD = Doc.getElementsByTagName("td")(0).innerText
IE.Quit
Dim aRD As Variant
sTD = Split(aTD, ",")
Range("Interface").Value = sTD(1)
Range("Switch").Value = sTD(2)
Range("Vlan").Value = sTD(0)
MsgBox tRD
End If
End Sub
aTD = Doc.getElementsByTagName("td")(0).innerText
Below is the entire script.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = Range("MAC_Address").Row And _
Target.Column = Range("MAC_Address").Column Then
Dim IE As New InternetExplorer
IE.Visible = True
IE.navigate "https://nnm/nnm/protected/switchportresults.jsp?endNodeName=" & Range("MAC_Address").Value
Do
DoEvents
Loop While IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.Container
Dim aTD As String
aTD = Doc.getElementsByTagName("td")(0).innerText
IE.Quit
Dim aRD As Variant
sTD = Split(aTD, ",")
Range("Interface").Value = sTD(1)
Range("Switch").Value = sTD(2)
Range("Vlan").Value = sTD(0)
MsgBox tRD
End If
End Sub