Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am currently running a web query that requires the macro to make a few
adjustments before submitting a form on a web page. All works well until I try to change a radio button. With IE .Visible = True .Navigate "http://www.freddiemac.com/mbs/cgi-bin/newdeal.pl?" ' Loop until the page is fully loaded Do Until Not .Busy DoEvents Loop Application.Wait (Now() + TimeValue("0:00:02")) ' Make the desired selections on the web page and click the submit Button Set ipf = IE.document.all.Item("RemicNum") ipf.Value = i Set ipf = IE.document.all.Item("SET") ipf.Value = "CHECKED" IE.document.Forms(0).submit Sadly, the code does not work. Does anyone know how I can change the button via the web query? Regards |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Regards, David Miller Sub DOIT() Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") With IE .Visible = True .Navigate "http://www.freddiemac.com/mbs/cgi-bin/newdeal.pl?" Do Until .readystate = 4 DoEvents Loop With .Document Set ipf = .all.Item("RemicNum") ipf.Value = i With .forms(0) For i = 0 To .Length - 1 With .Item(i) If .Value = "SET" Then .Checked = True End If End With Next .submit End With End With End With Set ipf = Nothing Set IE = Nothing End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked perfectly! You have saved me hours of frustration as I would
never have thought of going through all the forms. Thanks a million! "Dave Miller" wrote: Try this: Regards, David Miller Sub DOIT() Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") With IE .Visible = True .Navigate "http://www.freddiemac.com/mbs/cgi-bin/newdeal.pl?" Do Until .readystate = 4 DoEvents Loop With .Document Set ipf = .all.Item("RemicNum") ipf.Value = i With .forms(0) For i = 0 To .Length - 1 With .Item(i) If .Value = "SET" Then .Checked = True End If End With Next .submit End With End With End With Set ipf = Nothing Set IE = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Webquery | Excel Worksheet Functions | |||
Webquery - Excel 2003 | Excel Programming | |||
Excel 2000 webquery fails for pages greater than 2k | Excel Programming | |||
Webquery datafield naming changed between excel versions 97 and 20 | Excel Programming | |||
Webquery | Excel Discussion (Misc queries) |