HTML values

  • Thread starter Thread starter mjack003
  • Start date Start date
M

mjack003

Howdy,

I'm pretty new to extracting info from IE into excel so I need some
major help here. I need to fill certain input values on a webpage,
"click" the submit button, and from there I should be able to extract
the info I need. Its the navigating the selection screen I'm having a
problem with. The HTML values I need, I believe are contained in this
section of the source code. So how do I change these input values in
the html code to what I need and submit?

<FORM name = F001 method=post>

<input name="screen_id" type="hidden"
value="Selection">
<input name="project_id_selected" type="hidden" value="">
<input name="dept_id_selected" type="hidden" value="">
<input name="missing_craft_selected" type="hidden" value="">
<input name="xl_or_html_selected" type="hidden" value="HTML">
<input name="output_format_selected" type="hidden" value="ALL">
<table WIDTH="100%">
<tr>
<td width="30%" >
</td>
<td width="30%" >
<input name="heading_message"
type="hidden"
value="Selection Screen">
<P align=center>
<INPUT style="font-size:27pt;WIDTH: 400px;
COLOR: green; HEIGHT:
61px"
value="Submit
Selection";
type=submit
name=".State"

onclick="this.value='Submit';"

Appreciate any help,
Mjack
 
No professionals out there can explain how to do this? I've done some
research and figured out how to get the results I need with the
"sendkeys" function but this is unreliable and very sketchy. If
someone could at least point me in the right direction I'd appreciate
it.

Best Regards,
Mjack
 
I figured it out from alternate sites. Just wanted to post for all
those that were having the same problem I was.



Sub webtest()
Dim ie As Object
Dim projNum As String
Dim dept As String


projNum = InputBox("Please enter a project number?", "Time Run")

On Error GoTo 1
Set ie = CreateObject("InternetExplorer.Application")
With ie
..navigate "<URL goes here>"
..Visible = True
Do While .Busy: DoEvents: Loop ' Loop until page is loaded
Do While .readyState <> 4: DoEvents: Loop
With .document.forms("F001") ' form name goes in ()
..project_id_pulldown.Value = projNum 'all form values listed
below
..xl_or_html.Value = "XL"
..dept_id.Value = "L" & dept
..output_format.Value = "EST"
..submit 'submit form values

End With

End With
Set ie = Nothing
Exit Sub
1: MsgBox "Unexpected Error, sorry."
ie.Quit
Set ie = Nothing
End Sub

Hope this is of help for all those that can't find help on automating
internet explorer from excel. All you need to know is your site form
names and input value fields.

Best Regards,
Mjack
 
Back
Top