Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing IE Via Attachmate 1

Status
Not open for further replies.

pseudoman

Programmer
Jan 8, 2004
16
US
The code I have so far is along these lines

Sub Main()

Dim Explorer As Object

Set Explorer = CreateObject ("InternetExplorer.Application")
If (Explorer is Nothing) Then
Msgbox "Could not create the IE object. Stopping Program."
STOP
End If

Explorer.Navigate " Explorer.Visible = True

Do While Explorer.Busy = True
DoEvents
Loop

End Sub

I haven't Quite figured out a method of navigation yet though, as I not well versed in IE objects....
But if you can help plz put you 2 cents in I am sure we have all been pondering this one...
 
Calc... I have looked high and low for a answer on how to navigate a webpage from extra and populate data in that page... but still no luck have any ideas?
 
What do you mean by "Navigate a webpage". Do you mean actually manipulating the data on a specific page? If so, use VBA to create and object. In break mode you'll be able to add a watch to the IE object and fully explore the objects inside (text boxes, etc).

calculus
 
It's been awhile since I've played with this, and never put it into production. Also assumes you have a static web page.

This code will open a new IE browser to CNet and put "Digital Cameras" in the search box at the upper left.

Code:
Sub TestIE()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.application")

IE.Navigate2 "[URL unfurl="true"]http://www.cnet.com"[/URL]
Do While IE.ReadyState <> READYSTATE_COMPLETE
    DoEvents
Loop

IE.Document.forms(0).Item(0).Value = "Digital Cameras"
IE.Visible = True                       'optional eye candy
Set IE = Nothing
End Sub

When you use VBA and Front Page to browse the objects, you'll see that the IE object has a document property. Inside the document property are forms and inside of forms are the objects you'll likely want to control. The trick is that the object browser in VB numbers them starting with 1,2,3,4... and the object responds to 0,1,2,3 numbering. With a little exploration you'll be off in no time.

Another very helpful trick is to open the web page in Front Page (or any other editor), check the name of the field you want to manipulate. You'll be able to see this same name under the object browser's name field.

Now that the project is complete, where do I send the invoice???

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top