hi,
this is what i now have...I added the Application.SendKeys "{ENTER}", True
before and after the msgbox zz. it works to automate clicking ok in the
many messageboxes, but it looks like i have to go in and click the first one
because the focus is put on the internet page and is lot from excel. so the
web page is open, then i go to excel and clikc the first ok. all the others
are clicked automatically. how can i make it to where i dont have to click
the first one? (maybe i just need top put the focus on excel after the web
page is opened and then put it back on IE). im not sure.
Dim myIE As New InternetExplorer
Public Sub EE()
Dim myURL As String
Dim myURL33 As String
Dim myDoc As HTMLDocument
Dim strSearch As String
'Set starting URL and search string
myURL = "
www.google.com"
'Make IE navigate to the URL and make browser visible
myIE.navigate myURL
myIE.Visible = True
Call EE2
End Sub
Sub EE2()
myIE.navigate "
www.aol.com "
myIE.Visible = True
While myIE.Busy: DoEvents: Wend
Set o = myIE.document.all.tags("A")
M = o.Length: mySubmit = -1
For r = 0 To M - 1: zz = ""
zz = zz & "Link Index : " & r & " of " & o.Length - 1
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . tabindex : " & o.Item(r).tabIndex
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . tagname : " & o.Item(r).tagName
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . href : " & o.Item(r).href
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . type : " & o.Item(r).Type
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . name : " & o.Item(r).Name
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . innerhtml : " & o.Item(r).innerHTML
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . outerhtml : " & o.Item(r).outerHTML
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . rel : " & o.Item(r).rel
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . rev : " & o.Item(r).rev
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . id : " & o.Item(r).ID
zz = zz & String(3, vbCrLf)
Application.SendKeys "{ENTER}", True
MsgBox zz
Application.SendKeys "{ENTER}", True
If InStr(1, o.Item(r).innerHTML, "Investigators Say Anthrax Suspect Acted
Alone", vbTextCompare) Then
MsgBox "= F O U N D =" & vbCrLf & o.Item(r).innerHTML
o.Item(r).Click: Exit For
End If
Next
End Sub
thanks in advance,
geebee