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?
 
Thanks for spending so much time on this...I really appreciate the effort.

I realized that about the textbox having to be active. Do you know how to activate it so that sendkeys will work? And again, where is some good documentation on Excel/VBA/Webpages? I'm doing this stuff more and more and could really use a lesson...
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I'm in the same boat with you on trying to figure out how to activate it--if it's even possible. All I've done with VBA/webpages before is to just bring up the page and copy it. I've never had to actually *interact* with a page before.

I can poke around and see if I find anything, though. Now I'm simply curious to see if it can be done :)
 
Upvote 0
This...
Code:
            Set myTextField = .document.all.Item("txtPart") 
            myTextField.Value = "1229G1619"
...will put in a part number into the Part Number TextBox. I *thought* that woul dbe good enough and that SendKeys would work...but apparently not...
 
Upvote 0
Todd

Can you post all the code you currently have?

Have you tried using AppActivate before SendKeys?
 
Upvote 0
Kristy

I have been following the post but I couldn't recall if the whole code was posted, I thought it was just snippets.:oops:

I'll go and look back.
 
Upvote 0
Todd

I think I've got it.
Code:
ie.document.forms(0).submit
I found this by first googling 'automating internet explorer from Excel VBA'.

The first link was to an article in **** Kuslekia's blog.

Within the article was this link to the MSDN.

From there I just trawled through the object models till I came to this FORM Element | form Object.
 
Upvote 0
That's great! Thanks!

Next question...

Since I can't do a Web Query on this, how can I copy the table?

I was thinking something along the lines of

Code:
       .document.Table(1).Value.Copy

...but no go...
 
Upvote 0
Todd

I thought you might ask that.:)

I looked into it a bit but couldn't find anything that jumped out.

I've got a bad feeling it might need to be done by parsing the HTML or something.:eek:

I'll have another go later and post back.
 
Upvote 0

Forum statistics

Threads
1,215,909
Messages
6,127,675
Members
449,397
Latest member
Bastbog

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