Control child windows of IE when born with VBA

tdnhan

New Member
Joined
Oct 29, 2020
Messages
1
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
I have a company website, my job is that when logging in to the site with ID and Pass, the site will display a link, I click on that link will generate a new Web window and I will push data from excel to that new Web window. I have set my VBA Code to login and click on the link successfully but cannot push data to that generated website. What should I do, please help me! Here is the VBA code that I have generated. I want my code to work in a new web window

Sub Control_IE()
Dim obj As New WebDriver
obj.Start "Internetexplorer", ""
obj.Get "http://tms.tct.vn/irj/portal"
'Enter the ID and Pass
obj.FindElementById("logonuidfield").SendKeys ("kkktt")
obj.FindElementById("logonpassfield").SendKeys ("nopass")
obj.FindElementByName("uidPasswordLogon").Click
'Waiting
Application.Wait DateAdd("s", 1, Now)
obj.FindElementById("bestFitViews_div").Click
Application.Wait DateAdd("s", 1, Now)
'New web
'work on a new web window and push data to the new web
obj.FindElementById("WD46").SendKeys ("0105")
obj.FindElementByName("WD53").SendKeys ("2010")
obj.FindElementByName("WD87").SendKeys ("6000686830")
obj.FindElementById("WDC3-img").Click
obj.FindElementByName("WDE3").SendKeys ("22102020")
obj.FindElementByName("WDEC-img").Click
obj.FindElementByClass("urEdf2TxtEnbl lsEdfLeftBrdRadius lsEdf3TxtHlpBtn").SendKeys ("0105")
End Sub
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Watch MrExcel Video

Forum statistics

Threads
1,123,426
Messages
5,601,585
Members
414,460
Latest member
uctc

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
Top