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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Let's try one more time...

Maybe I should be more clear since my original doesn't make any sense...

There is a webpage that I wish to query. There is a part number field on the webpage that Excel fills in with a part number from a list on a worksheet. The issue I have is that, now, normally, when I have done this before, there has been a "Submit" command button on the webpage that will submit the query once the part number field has been populated by Excel. However, the webpage I'm working with this time has no "Submit" button. If I were to "Submit" manually, i would hit the Enter button. How can I get Excel to hit the "Enter" button for me?
 
Upvote 0
Hey Todd - -

When I write a macro to do web stuff and it is in IE, in a separate window, the sendkeys function works for me. Might this codeline to simulate the Enter keypress work for you, if you place the line at the corrrect point in your macro when the web page window is active?


Application.SendKeys "{ENTER}"
 
Upvote 0
Thanks Tom for responding.

I tried SendKeys and it did not work...in fact it was the first thing I had thought of...

I'm going to let this topic go and just do it the ol' fashion way, but it still remains a mystery to me...
 
Upvote 0
It might be that if the web page author removed the Submit button, it was done for a reason, and they don't want something submitted. Though I guess if that was the case, then manually pressing Enter would not help either, though you say it gets you where you want to be. Usually, Enter is the act for accepting a default action, so it seems there must be some command object on that page that represents a default, absent text instruction. Strange.
 
Upvote 0
No idea if it would help at all but have you looked at the source code of the webpage? It could have programming that hints at why it works when you hit enter even though there is no "submit" button.
 
Upvote 0
Haha...after staring at the webpage for 20 minutes, I realized that there is a very small .gif that says "Search". So I clicked and it "submitted" the query!

Still don't know why SendKeys did not work...just one of those things I suppose...
 
Upvote 0
Another possibility? You could look at the source code to figure out the url to return the results for the specific item you're looking for--that way you wouldnt' even need to go to the webpage and enter the number.

Like the board's search function, for example. When you search it takes you to results.php and you have no ability to link to the results. However, if you look at the source code of the search page you can figure out the keywords and use those to link directly. For example, this link will return search results for the words "conditional formatting" in the Excel Questions forum only:
Code:
http://www.mrexcel.com/board2/search.php?search_keywords=conditional%20formatting&search_forum=2

I did this same kind of thing with a "report" on the intranet at work. Instead of going to the webpage, selecting items from the dropdown, submitting and then copy/paste the results to a sheet, I just dug around the source code to figure out the keywords. Now I just point my code that copies the webpage to that results page directly :)
 
Upvote 0
Won't work...uhg, I can't recall what type of webpage you call it...but either way, it's the type that when you submit a query it updates the results at the same web address.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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