I am trying take values from excel to web app here is the code. it is not working. I am attaching the source code of the html
How can i automate excel to web application
Below is the html code for each of the web button
Manage Company
Select Store
Date Range
Last Four Digits
Search
How can i automate excel to web application
Code:
[COLOR=#0B374D][FONT=Courier]Option ExplicitSub SubmitToWeb()Dim rw As Long, ws As WorksheetDim IE As ObjectApplication.ScreenUpdating = False Set ws = Worksheets("Sheet2") Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True IE.Navigate "https:XXXX" Application.StatusBar = "Submitting" ' Wait while IE loading... While IE.Busy DoEvents Wend For rw = 2 To ws.Range("A1").CurrentRegion.Rows.Count ' ********************************************************************** delay 4 IE.document.getElementById("ctl00_ManagedCompaniesComboBox").Value = ws.Range("A" & rw) delay 2 Set ElementCol = IE.document.getelementsbytagname("a")' loop through all 'input' elements and find the one with the value "Yes"For Each elea In ElementColIf InStr(elea.innerhtml, "MtxResource.asmx?r=Icons/Search.png") > 0 Thenelea.ClickExit ForEnd IfNext delay 2 IE.document.getElementById("_cb_Control_ctl00_MainContent_SearchWizard_SearchCriteriaStep_SearchCriteria_StoresComboBox").Value = ws.Range("B" & rw) ' How do i click on tranasaction search buttion delay 1 IE.document.getElementById("_cb_Control_ctl00_MainContent_SearchWizard_SearchCriteriaStep_SearchCriteria_StoresComboBox").Value = ws.Range("C" & rw) delay 1 IE.document.getElementById("ctl00$MainContent$SearchWizard$SearchCriteriaStep$SearchCriteria$AccountLast4TextBox").Value = ws.Range("D" & rw) delay 1 IE.document.getElementById("ctl00$MainContent$SearchWizard$SearchCriteriaStep$SearchCriteria$SearchDates_TextBox").Value = ws.Range("E" & rw) delay 1 IE.document.getElementById("ctl00$MainContent$SearchWizard$SearchCriteriaStep$SearchCriteria$AccountLast4TextBo").Value = ws.Range("E" & rw) delay 1 IE.document.getElementById("ctl00$MainContent$SearchWizard$SearchCriteriaStep$SearchCriteria$SearchTransactionsButton").Click '********************************************************************** Next rw Application.StatusBar = "Form Submitted" IE.Quit Set IE = Nothing Application.ScreenUpdating = TrueEnd SubPrivate Sub delay(seconds As Long) Dim endTime As Date endTime = DateAdd("s", seconds, Now()) Do While Now() < endTime DoEvents LoopEnd Sub[/FONT][/COLOR]
Below is the html code for each of the web button
Manage Company
HTML:
Transaction search
Data Loading... Home | Transaction Search | Reports
Select Store
HTML:
Date Range
HTML:
Last Four Digits
HTML:
Search
HTML: