How To Activate Go Back Button in This Script

rikeshpatel4u

New Member
Joined
Mar 30, 2019
Messages
1
Sub DynamicWebPage()


' here I define elemnts for the loop
Dim sht As Worksheet
Set sht = ThisWorkbook.Sheets("Sheet2")
Dim LastRow As Long
Dim i As Long
LastRow = sht.Cells(sht.Rows.Count, "D").End(xlUp).Row


' here I define Internet Explorer
Dim IE As Object
Dim Doc As HTMLDocument
Set IE = CreateObject("InternetExplorer.Application")


' here I define range for the loop
For i = 2 To LastRow


' here I ask the Internet explorer to be visable & Navigate to value in cell "H"i
IE.Visible = True
IE.navigate "https://www1.incometaxindiaefiling.gov.in/e-FilingGS/Services/AadhaarPreloginStatus.html"


' here I ask the Internet explorer to wait few seconds


Do While IE.Busy
Application.Wait DateAdd("s", 2, Now)


' here I define Object to sendkeys
Dim SHELL_OBJECT
SHELL_OBJECT = "WScript.Shell"
Set objShell = CreateObject(SHELL_OBJECT)




Set Doc = IE.document


'******* From here the macro fill the data from excel table in range into WEB elements******


Doc.getElementById("panNo").Value = sht.Range("D" & i).Value
Doc.getElementById("aadhaarNo").Value = sht.Range("E" & i).Value
Doc.getElementById("aadhaarbtn").Click
IE.Visible = 1
IE.GoBack


Loop


' here I ask to populate column "G"i with "created" string to know that this raw was successfully done
sht.Range("G" & i).Value = "linked"


Next i
MsgBox "Process 100% completed"


End Sub
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Watch MrExcel Video

Forum statistics

Threads
1,096,431
Messages
5,450,389
Members
405,608
Latest member
griffindor2020

This Week's Hot Topics

Top