PDA

View Full Version : IE Control using VBA



photon_ed
03-05-2008, 10:57 AM
Hello vbaexpress,

There is a list of 3 things I need to know the vba codes for IE control,
I would be grateful if you can give provid me with some examples.

1. Search on google
2. Click on a hyperlink on webpage
3. selecting check boxes and confirm press the "ok" button.

Many thanks.

Regards,
Ed

photon_ed
03-05-2008, 11:36 AM
Guys, I got the first one and now 2 to go :)

Function Search_Google()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate "http://www.google.com" 'load web page google.com
While ie.Busy
DoEvents 'wait until IE is done loading page.
Wend
ie.Visible = True
'ie is now done loading the page
ie.Document.All("q").Value = "what you want to put in text box"
MsgBox "" 'puts info into the inputbox named "q" which is google's search box.
ie.Document.All("btnG").Click 'clicks the button named "btng" which is google's "google search" button
MsgBox ""
While ie.Busy
DoEvents 'wait until IE is done loading page.
Wend
'ie is now done loading the results page
End Function

Check link below for details
http://www.xtremevbtalk.com/showthread.php?t=144175