I have used oie.readystate, then checked oie.document.readystate, then
oie.busy before the code would work. It always seemed to me MS would have
one method call that would suffice, but I have found that not to be true.

John Harvey
901-828-2943

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Fred Taylor
Sent: Tuesday, July 14, 2009 6:28 PM
To: ProFox Email List
Subject: Re: VFP controlling IE; works in CW; DW, not in program

The ReadyState doesn't seem to change from 4 when you do the button.Click,
so the code just falls through.  Waiting some period of time before
processing the results of the click works, so something other than
ReadyState would have to be checked.

Fred


On Tue, Jul 14, 2009 at 3:48 PM, Bill Anderson <[email protected]> wrote:

> Nope, that's what WaitForReadyState does, it delays until IE reaches a
> ready
> state.
>
> Bill
>
> On Tue, Jul 14, 2009 at 3:40 PM, <[email protected]> wrote:
>
> > Try putting a wait timeout (5) seconds in before you loop through the
> > nodes.
> > It may be that your code is hitting before the page is rendered.
> >
> >
> >
> >  Tue, 14 Jul 2009 15:00:51 -0700
> >   Bill Anderson <[email protected]> wrote:
> > >The following is a cut down version of automating Google searches.
> > >
> > >goIE = CREATEOBJECT([InternetExplorer.Application])
> > >goIE.Navigate2([<<a href="http://www.google.com])"  target="top"
> > >>>http://www.google.com])<</a>>
> > >WaitForReadyState(4, 5000)
> > >loInputElements = goIE.Document.GetElementsByTagName([Input])
> > >loGoogleSearchInput = loInputElements.Item(1) && search field
> > >loGoogleSearchButton = loInputElements.Item(2)
> > >loGoogleSearchInput.Value  = [TEST]
> > >loGoogleSearchButton.Click()
> > >WaitForReadyState(4, 5000)
> > >loNodes = goIE.Document.GetElementsByTagName([A])
> > >li = 0
> > >
> > >FOR EACH loNode IN loNodes
> > >
> > >  li = li + 1
> > >
> > >  IF loNode.ClassName = [l]
> > >
> > >    ?li
> > >    ?loNode.InnerHTML
> > >    ?loNode.ToString
> > >
> > >  ENDIF
> > >
> > >ENDFOR
> > >
> > >If I run this at the command window (putting the FOR loop in a temp
> > program
> > >and run it) I get what's expected. If I run it step by step in the
> > debugger
> > >I get what's expected.
> > >
> > >But if I run it as a program, I get no display.
> > >
> > >Suspending the program and trying this at the command window
> > >
> > >xxx = lonodes.item[1]
> > >
> > >Produces a "OLE error code 0x80070005: Access is denied." error using
> IE8.
> > >IE6 doesn't provide any error, just doesn't seem to work. Using XP SP3.
> > >
> > >I assume this is some sort of IE security setting but I wouldn't know
> > where
> > >to turn. Again, this works at the command window and the debugging
> window
> > if
> > >I step through the code...but not running it.
> > >
> > >Thanks for any help,
> > >
> > >Bill Anderson
> >
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
>  text/plain (text body -- kept)
>  text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/026001ca04de$a6889460$f399bd...@[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to