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