vba to web automation

oodai

New Member
Joined
Oct 13, 2010
Messages
4
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

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:
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,998
Messages
6,122,639
Members
449,093
Latest member
Ahmad123098

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top