Autoamting Internet Explorer webpage using VBA, but stuck with a window popup to enter a value

SATZ

New Member
Joined
Mar 14, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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.
 

Attachments

  • IE.PNG
    IE.PNG
    25.2 KB · Views: 53

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,214,409
Messages
6,119,339
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top