ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting Change in State of Internet Explorer (https://www.excelbanter.com/excel-programming/374212-detecting-change-state-internet-explorer.html)

ash

Detecting Change in State of Internet Explorer
 
I'm writing a macro to copy data to and from a web page using mainly the send
keys function. Currently I have set a long wait period in the code while the
site updates. This not only makes the macro run slower than it needs to but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account information.

NickHK[_3_]

Detecting Change in State of Internet Explorer
 
Why automate IE ?
Here's 1 example :
http://support.microsoft.com/kb/167658

NickHK

"Ash" ...
I'm writing a macro to copy data to and from a web page using mainly the
send
keys function. Currently I have set a long wait period in the code while
the
site updates. This not only makes the macro run slower than it needs to
but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account information.




ash

Detecting Change in State of Internet Explorer
 
While automating IE should work I am limited in the way I can access the site
because of company policy. I need to find a way to find out when the site
has loaded the second page.

"NickHK" wrote:

Why automate IE ?
Here's 1 example :
http://support.microsoft.com/kb/167658

NickHK

"Ash" ...
I'm writing a macro to copy data to and from a web page using mainly the
send
keys function. Currently I have set a long wait period in the code while
the
site updates. This not only makes the macro run slower than it needs to
but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account information.





NickHK[_3_]

Detecting Change in State of Internet Explorer
 
Does that mean you cannot automate IE ?

Or you can talk directly to the server.

NickHK

"Ash" ...
While automating IE should work I am limited in the way I can access the
site
because of company policy. I need to find a way to find out when the site
has loaded the second page.

"NickHK" wrote:

Why automate IE ?
Here's 1 example :
http://support.microsoft.com/kb/167658

NickHK

"Ash" ...

I'm writing a macro to copy data to and from a web page using mainly
the
send
keys function. Currently I have set a long wait period in the code
while
the
site updates. This not only makes the macro run slower than it needs
to
but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account
information.







ash

Detecting Change in State of Internet Explorer
 
I can do very little. I am restricted to beed able to use send keys to
select a textbox on the site and goto the enter button. after that It using
send keys again to select information.

"NickHK" wrote:

Does that mean you cannot automate IE ?

Or you can talk directly to the server.

NickHK

"Ash" ...
While automating IE should work I am limited in the way I can access the
site
because of company policy. I need to find a way to find out when the site
has loaded the second page.

"NickHK" wrote:

Why automate IE ?
Here's 1 example :
http://support.microsoft.com/kb/167658

NickHK

"Ash" ...

I'm writing a macro to copy data to and from a web page using mainly
the
send
keys function. Currently I have set a long wait period in the code
while
the
site updates. This not only makes the macro run slower than it needs
to
but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account
information.







NickHK[_3_]

Detecting Change in State of Internet Explorer
 
If you can ONLY use SendKeys as a requirements, then it seems you in for
alot of trouble every time there is a small layout change in the controls on
the pages etc.
Good luck.

And I suppose an Excel web query is out of the question ?

NickHK

"Ash" ...
I can do very little. I am restricted to beed able to use send keys to
select a textbox on the site and goto the enter button. after that It
using
send keys again to select information.

"NickHK" wrote:

Does that mean you cannot automate IE ?

Or you can talk directly to the server.

NickHK

"Ash" ...

While automating IE should work I am limited in the way I can access
the
site
because of company policy. I need to find a way to find out when the
site
has loaded the second page.

"NickHK" wrote:

Why automate IE ?
Here's 1 example :
http://support.microsoft.com/kb/167658

NickHK

"Ash" ...

I'm writing a macro to copy data to and from a web page using mainly
the
send
keys function. Currently I have set a long wait period in the code
while
the
site updates. This not only makes the macro run slower than it
needs
to
but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect
a
change. Eg when the site move from account search to account
information.









ash

Detecting Change in State of Internet Explorer
 
It's been interesting. I've got everytthing working perfect apart from when
the web based system is running sluggish and the wait time I have for a web
page isn't long enough.

"NickHK" wrote:

If you can ONLY use SendKeys as a requirements, then it seems you in for
alot of trouble every time there is a small layout change in the controls on
the pages etc.
Good luck.

And I suppose an Excel web query is out of the question ?

NickHK

"Ash" ...
I can do very little. I am restricted to beed able to use send keys to
select a textbox on the site and goto the enter button. after that It
using
send keys again to select information.

"NickHK" wrote:

Does that mean you cannot automate IE ?

Or you can talk directly to the server.

NickHK

"Ash" ...

While automating IE should work I am limited in the way I can access
the
site
because of company policy. I need to find a way to find out when the
site
has loaded the second page.

"NickHK" wrote:

Why automate IE ?
Here's 1 example :
http://support.microsoft.com/kb/167658

NickHK

"Ash" ...

I'm writing a macro to copy data to and from a web page using mainly
the
send
keys function. Currently I have set a long wait period in the code
while
the
site updates. This not only makes the macro run slower than it
needs
to
but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect
a
change. Eg when the site move from account search to account
information.










ron

Detecting Change in State of Internet Explorer
 
Ash wrote:
I'm writing a macro to copy data to and from a web page using mainly the send
keys function. Currently I have set a long wait period in the code while the
site updates. This not only makes the macro run slower than it needs to but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account information.


It sounds like you are using SENDKEY (ugh!) to enter info on a web
page, click enter or some similar button and then a new web page
appears. If you are trying to detect when this new page is fully
loaded, insert something like the following loop in your code...Ron

Do Until .ReadyState = READYSTATE_COMPLETE And Not .Busy
DoEvents
Loop


Nigel

Detecting Change in State of Internet Explorer
 
Not sure if this helps but I use this to wait for a response, I have in the
past also used the OnTime function to time this out if needed.

Sub WebLink()
Set ie = CreateObject("InternetExplorer.Application")

sURL = "http://www.yourpage.com"

ie.Navigate sURL

'wait for response
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop

ie.Visible = True

ie.Quit
Set ie = Nothing

End Sub


--
Cheers
Nigel



"Ash" wrote in message
...
I'm writing a macro to copy data to and from a web page using mainly the
send
keys function. Currently I have set a long wait period in the code while
the
site updates. This not only makes the macro run slower than it needs to
but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account information.




[email protected]

Detecting Change in State of Internet Explorer
 
You can also try SWExplorerAutomation SWEA (http://webunittesting.com).
SWEA makes IE automation a very simple task.

Ash wrote:
I'm writing a macro to copy data to and from a web page using mainly the send
keys function. Currently I have set a long wait period in the code while the
site updates. This not only makes the macro run slower than it needs to but
also cannot detect if the site crashes.

Does anyone know a way i can check the state of the site and detect a
change. Eg when the site move from account search to account information.




All times are GMT +1. The time now is 04:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com