Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Import by Webquery

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Excel Import by Webquery

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Import by Webquery

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Webquery Neale Excel Worksheet Functions 3 August 25th 08 05:26 PM
Webquery - Excel 2003 kanind Excel Programming 4 November 28th 06 07:38 AM
Excel 2000 webquery fails for pages greater than 2k [email protected] Excel Programming 1 August 11th 06 06:17 AM
Webquery datafield naming changed between excel versions 97 and 20 nippetee Excel Programming 0 January 26th 05 12:57 PM
Webquery Othello Excel Discussion (Misc queries) 0 December 1st 04 12:41 PM


All times are GMT +1. The time now is 12:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"