Tejas Kore
Board Regular
- Joined
- Nov 2, 2017
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
Hi All,
Facing the error on highlighted line. Selected proper object libraries. Please find the attached screenshot for selected libraries.
Tried to reference getElementsByTagName method directly "sDD = ieDoc.getElementsByTagName("dd")(3).innerText" like ieApp.document.getElementsByTagName("dd")(3).innerText but still error remains the same.
Facing the error on highlighted line. Selected proper object libraries. Please find the attached screenshot for selected libraries.
Rich (BB code):
Sub login_page()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
'Dim ieTable As Object
'Dim clip As DataObject
Dim wb As Workbook
Dim ws As Worksheet
Dim doc As HTMLDocument
Set wb = ThisWorkbook
Set ws = wb.Sheets("Sheet1")
'create a new instance of ie
Set ieApp = New InternetExplorerMedium
'Set doc = ieApp.document
'you don’t need this, but it’s good for debugging
ieApp.Visible = True
ieApp.navigate "Company website"
Do
DoEvents
Loop Until ieApp.readyState = READYSTATE_COMPLETE
ieApp.document.all("txtIP").Value = ws.Cells(2, 1).Value
ieApp.document.all("btnSearch").Click
Do
DoEvents
Loop Until ieApp.readyState = READYSTATE_COMPLETE
Set ieDoc = ieApp.document
Dim sDD As String
sDD = ieDoc.getElementsByTagName("dd")(3).innerText
'MsgBox sDD
ws.Cells(2, 2) = sDD
ieApp.navigate "Company website"
End Sub
Tried to reference getElementsByTagName method directly "sDD = ieDoc.getElementsByTagName("dd")(3).innerText" like ieApp.document.getElementsByTagName("dd")(3).innerText but still error remains the same.
Last edited by a moderator: