Submitting w/o Submit button (Web)

Todd Bardoni

Well-known Member
Joined
Aug 29, 2002
Messages
3,042
I'm trying to query a webpage...

Excel enters the value into the field I want. To submit manually, I have to hit the Enter key since there is no command button on the webpage. How can I have Excel hit Enter automatically? Is this even clear?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You mean the search form appears at the top and the results magically appear under that after you search? Something like that?

Hard to say without seeing it, but it could be using frames. If that's the case, I think that would still be do-able as each frame is actually a separate page. Could be that the portion that returns the results is simply linking to the results such like in my example using the board search.

*shrug* But, you (hopefully) know what's going on with the site in question better than me :)
 
Upvote 0
Hmm, no, I don't know that's the problem... :)

So, you're saying that the frames are sort of stacked? So, then how does one do a query like this? I've tried doing this before and couldn't figure it out in the least (mainly from some advice I got from a co-worker about these types of webpages...now, seemingly bad advice)....

Also, where's the second best place (next to this site) to read up on VBA and webpages?
 
Upvote 0
Oh! No, I posted the above before seeing your link to the page. The frames thing was just a gues as I hadn't seen the page at that point.

I can take a look, though, see if it's feasible. Though the code I use to copy a web page copies the *entire* page--so if it does work, you'd still have to delete the images, things like that.
 
Upvote 0
Cool. I don't care if everything is copied....I'll just write some code to organize it, etc.

If you can figure it out I'd OWE you big time because there is another site that I've been dying to figure out how to query and it's set up the same way as this one. Basically, I'm tracking gov't solicitation and awards (or at least trying to)...but the problem is that there is no common "key" between the solicitations and awards...so I have to look at the solicitations manually and see if there was an award. BUT, there is one site that gives the solicitation number with the award and I can use that as the common "key" between the two sets of data. But I have the same issue with that site as I do given in the link posted above.
 
Upvote 0
Ok--looking at the HTML for that page, I *think* this may be do-able.

Can you give an example of what you would enter on that page to search by? I can't seem to get anything to work--I am just entering made up numbers, though. :)
 
Upvote 0
Here's the code I'm working with thus far:

Code:
Sub WebQuery()
    Set ie = CreateObject("InternetExplorer.Application")
    With ie
        .Visible = True
            .navigate "http://www.xpresswayplus.com/webapp/magec/servlet/Production"
            Do Until .readystate = 4
                DoEvents
            Loop
            Set myTextField = .document.all.Item("txtPart")
            myTextField.Value = "1229G1619"
            
            Application.SendKeys "{ENTER}"
            
            Do Until .readystate = 4: DoEvents: Loop
            Do While .busy: DoEvents: Loop
    End With
End Sub
 
Upvote 0
Wow. You're right, this page IS a pain.

So far, I haven't been able to get it. In theory, it should work by simply using this url:
Code:
http://www.xpresswayplus.com/webapp/magec/servlet/Production?txtPart=1229G1619&txtDate=20060503

However, I have been unable to get that to work. It appears that it may simply be rewriting the page on the fly to insert the search results so that this direct link search won't work? Idunno.

Very aggravating, though :confused:
 
Upvote 0
By the way, I think I just figured out why sendkeys isn't working. The form on the page has to be "active" for it to work.

Enter the number manually into the form, click anywhere in the white area outside the form and press enter. Nothing happens.

Generally speaking, if you enter the number manually the cursor would then still be within the form so when you press enter it is being detected as such. Even if you click the mouse in the text labels for the form it works.

If outside that, nothing.
 
Upvote 0

Forum statistics

Threads
1,215,951
Messages
6,127,909
Members
449,411
Latest member
AppellatePerson

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