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
 

Forum statistics

Threads
1,081,705
Messages
5,360,751
Members
400,595
Latest member
T_Dubs

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top