ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Web Access Timeout (https://www.excelbanter.com/excel-programming/292107-web-access-timeout.html)

Nigel[_6_]

Web Access Timeout
 
Hi All

I am using the following code to wait for an Internet call to complete.

Do Until oIE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

My problem is that on occasions the web site may not respond or the netwok
is slow, in this situation I would like to timeout the session after say 15
seconds. I have looked at using the Application.OnTime event but have not
been successful.

Any thoughts?

TIA
Cheers
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Dick Kusleika[_3_]

Web Access Timeout
 
Nigel

Create a date variable and check NOW vs some start time

Dim StartTime as Date

StartTime = Now

Do Until oIE.ReadyState = READYSTATE_COMPLETE Or
(Now-StartTime)TimeValue("00:00:15")

DoEvent
Loop

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Nigel" wrote in message
...
Hi All

I am using the following code to wait for an Internet call to complete.

Do Until oIE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

My problem is that on occasions the web site may not respond or the netwok
is slow, in this situation I would like to timeout the session after say

15
seconds. I have looked at using the Application.OnTime event but have not
been successful.

Any thoughts?

TIA
Cheers
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---



Nigel[_6_]

Web Access Timeout
 
Dick,

Thanks very much, I have been pondering this for two days! You solution is
so simple.

Cheers
Nigel



"Dick Kusleika" wrote in message
...
Nigel

Create a date variable and check NOW vs some start time

Dim StartTime as Date

StartTime = Now

Do Until oIE.ReadyState = READYSTATE_COMPLETE Or
(Now-StartTime)TimeValue("00:00:15")

DoEvent
Loop

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Nigel" wrote in message
...
Hi All

I am using the following code to wait for an Internet call to complete.

Do Until oIE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

My problem is that on occasions the web site may not respond or the

netwok
is slow, in this situation I would like to timeout the session after say

15
seconds. I have looked at using the Application.OnTime event but have

not
been successful.

Any thoughts?

TIA
Cheers
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Richard Bell

Web Access Timeout
 

Just a safety tip ...

Notwithstanding the documentation, ReadyState = READYSTATE_COMPLETE is
NOT a reliable way to check for the web page actually being completely
downloaded. While it will work much of the time, there are many sites
that will generate ReadyState complete (particularly on a frame), and
then proceed to continue to load (generally in other frames). A
stronger technique is to catch the DocumentComplete event for the IE
main window. This will work almost always but will fail for certain
sites that do not complete their loading untill after the IE main
window signals load complete.


On Sat, 21 Feb 2004 13:10:03 -0600, "Dick Kusleika"
wrote:

Nigel

Create a date variable and check NOW vs some start time

Dim StartTime as Date

StartTime = Now

Do Until oIE.ReadyState = READYSTATE_COMPLETE Or
(Now-StartTime)TimeValue("00:00:15")

DoEvent
Loop




All times are GMT +1. The time now is 05:33 PM.

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