VenkatesanPR
New Member
- Joined
- Jul 24, 2020
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
im not good in coding i tried getElementByID and TagName ClassName but couldn't find newplate id "ctl00_Contentplaceholder_txtNewPlate" how enter value in newplate textbox and click search button by excel vba .
i tried the following vba code to get the id names but it returned login form textbox id.
please help me. thanks in advance
i tried the following vba code to get the id names but it returned login form textbox id.
please help me. thanks in advance
VBA Code:
Sub IE_Autiomation()
Dim i As Long
Dim IE As Object
' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")
' You can uncoment Next line To see form results
IE.Visible = True
Dim Login, WOSearch, FMenu As String
Login = "http://10.10.10.232/FMS/Login.aspx"
FMenu = "http://10.10.10.232/FMS/FleetMenu.aspx"
WOSearch = "http://10.10.10.232/FMS/Search/FleetWOSearch.aspx"
IE.Navigate Login
Do
Loop Until IE.ReadyState = READYSTATE_COMPLETE
IE.Document.getElementById("txtUserId").Value = "sajed"
IE.Document.getElementById("txtPassword").Value = "Password1"
IE.Document.getElementById("imgbntOK").Click
' Send the form data To URL As POST binary request
IE.Navigate WOSearch
Dim divs As Object
Dim div As Object
Set divs = IE.Document.getElementsByClassName("textbox")
i = 0
For Each div In divs
If div.ID = "ctl00_Contentplaceholder_txtNewPlate" Then
div.innerText = "16/97214"
End If
i = i + 1
Sheets("Sheet2").Range("A" & i) = div.ID & i
Next
Set divs = IE.Document.getElementsByClassName("textbox")
i = 0
For Each div In divs
If div.ID = "ctl00_Contentplaceholder_txtNewPlate" Then
div.innerText = "16/97214"
End If
i = i + 1
Sheets("Sheet2").Range("A" & i) = div.ID & i
Next
' Show IE
IE.Visible = True
' Clean up
Set IE = Nothing
Application.StatusBar = ""
End Sub
please share email address to send the pagecode
[URL]http://10.10.10.232/FMS/Search/FleetWOSearch.aspx[/URL]