• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2957
  • Last Modified:

Excel's VBA manipulating Internet Explorer Form

Greetings - this one should be quite simple, but I just can't figure out the syntax.

I am trying to write a VBA program in Excel which launches Internet Explorer, Navigates to a specific web page, and pastes information into the Form on that web page.

I have the launching and navigating working fine.

I can write text to the web page - but the text doesn't show up in the form on the web page.  I am having a  hard time manipulating the form once I am there.  Any help would be appreciated.

Here's what I have so far:

Sub test()

Dim ie As Object
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.navigate ("c:\new_page_5.htm")

'this will write to the web screen - just not in the form
screen = ie.document.Focus
ie.document.write ("testing the ability to send information to the i.e. screen")

End Sub

Thanks,
Dave
0
da29647
Asked:
da29647
1 Solution
 
Ryan ChongCommented:
See this documentation by Richie_Simonetti:

http://www.angelfire.com/realm/vb-shared/IE_WB_DOM_tips.htm#log
0
 
da29647Author Commented:
Exactly what I needed to take the next step.  Thanks for the rapid response.


Here's the final code for the rest of the world:

Sub test()

'this demonstrates how to integrate Excel with Internet Explorer
'this will launch Ie, navigate to a page, and send data from
'Excel into the User form.
'this is written in VBA


Dim ie As Object
Dim form_item As Object

Set ie = CreateObject("InternetExplorer.application")

'make internet explorer visible
ie.Visible = True

'navigates to page with form
ie.navigate ("c:\new_page_5.htm")

'the name of the form item is S1
Set form_item = ie.document.all.Item("S1")

'goes through the Excel rows and makes a gigantic string with each segment
'of the string separated by a line feed
For Row = 2 To 501
    grabbed_out = grabbed_out & Cells(Row, 2) & Chr(13)
Next Row

'places the value of that entire string into the form
form_item.Value = grabbed_out

End Sub
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now