How To Activate Go Back Button in This Script


New Member
Mar 30, 2019
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 ""

' 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
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
IE.Visible = 1


' 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

Latest member

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...