Automating the manual process in Internet explorer webpage using VBA. When clicking on a text box in a page, it displays a seperate Window Popup.
There is a text field in the window popup, where i have to enter a value, but no HTML code is associated to that popup(as i dont see Inspect element to get the HTML code).
So how do i get to the textbox in the window dialog box that pops up and enter the value?? when there is no "inspect element" is available.
Note: Webpage is access restricted,so cant share the link.
**************************Code*****************************************
On Error GoTo ErrHandler
Application.ScreenUpdating = False
Set data_sheet = ThisWorkbook.Sheets("Input")
' Count the number of rows
iTotalRows = data_sheet.Cells(Rows.Count, 1).End(xlUp).Row
'If iTotalRows > 1 Then
' Start session
Dim ie As InternetExplorer
Dim win As Object
Dim elements As MSHTML.IHTMLElementCollection
Dim nameValueInput As MSHTML.HTMLInputElement
Dim oHTML_Element As IHTMLElement
Dim Outcome
Dim i As Long
Dim Wnk As HTMLLinkElement
Set ie = New InternetExplorerMedium
ie.Silent = True
ie.Navigate "URL"
ie.Visible = True
Do While ie.readyState <> READYSTATE_COMPLETE
Loop
Dim idoc As MSHTML.HTMLDocument
Set idoc = ie.Document
Do While ie.Busy = True Or ie.readyState < 4: DoEvents: Loop
Application.Wait (Now() + TimeValue("00:00:2"))
Set elements = idoc.getElementsByName("userBSB")
For Each oHTML_Element In idoc.getElementsByTagName("input")
If oHTML_Element.Name = "userBSB" Then oHTML_Element.Click: Exit For
Next
Do While ie.Busy = True Or ie.readyState < 4: DoEvents: Loop
Application.Wait (Now() + TimeValue("00:00:3"))
' Not sure how to proceed from here to give a value in the text box of a new window popup,couldnt get a HTML code to it(F12, or Inspect element is anot available)
Could anyone let me know how do i proceed from here?
Any help would be appreciated.
There is a text field in the window popup, where i have to enter a value, but no HTML code is associated to that popup(as i dont see Inspect element to get the HTML code).
So how do i get to the textbox in the window dialog box that pops up and enter the value?? when there is no "inspect element" is available.
Note: Webpage is access restricted,so cant share the link.
**************************Code*****************************************
On Error GoTo ErrHandler
Application.ScreenUpdating = False
Set data_sheet = ThisWorkbook.Sheets("Input")
' Count the number of rows
iTotalRows = data_sheet.Cells(Rows.Count, 1).End(xlUp).Row
'If iTotalRows > 1 Then
' Start session
Dim ie As InternetExplorer
Dim win As Object
Dim elements As MSHTML.IHTMLElementCollection
Dim nameValueInput As MSHTML.HTMLInputElement
Dim oHTML_Element As IHTMLElement
Dim Outcome
Dim i As Long
Dim Wnk As HTMLLinkElement
Set ie = New InternetExplorerMedium
ie.Silent = True
ie.Navigate "URL"
ie.Visible = True
Do While ie.readyState <> READYSTATE_COMPLETE
Loop
Dim idoc As MSHTML.HTMLDocument
Set idoc = ie.Document
Do While ie.Busy = True Or ie.readyState < 4: DoEvents: Loop
Application.Wait (Now() + TimeValue("00:00:2"))
Set elements = idoc.getElementsByName("userBSB")
For Each oHTML_Element In idoc.getElementsByTagName("input")
If oHTML_Element.Name = "userBSB" Then oHTML_Element.Click: Exit For
Next
Do While ie.Busy = True Or ie.readyState < 4: DoEvents: Loop
Application.Wait (Now() + TimeValue("00:00:3"))
' Not sure how to proceed from here to give a value in the text box of a new window popup,couldnt get a HTML code to it(F12, or Inspect element is anot available)
Could anyone let me know how do i proceed from here?
Any help would be appreciated.