yannickb
09-01-2010, 03:49 AM
Hi Everyone,
I Made a VBA Macro for Excel, the VBA script checks several websites for links, source code etc. I get the links out of the source code by doc.Links
Before the source-code is being downloaded I'm checking if the site is completely loaded. I perform this check by the following code:
While ((doc.readyState <> "complete"))
DoEvents
Wend
With hundreds of websites this is working correct, but several websites doesn't give a 'Complete'-status back. So i started to search for a solution which could fix this and added the following code:
Start = Timer
While ((doc.readyState <> "complete"))
If ((Timer - Start) > 30) Then
' Voer actie uit
Else
DoEvents
End if
Wend
So after 30 seconds the script would continue, but strangly enough several websites like these:
- f1pits.net
- fr-fans.nl
Keep giving problems, as soon as the script reaches
While ((doc.readyState <> "complete"))
Excel crashes completely and needs to be restarted, do you have any idea how i could fix this?
Thanks a lot!
Regards Yannick
I Made a VBA Macro for Excel, the VBA script checks several websites for links, source code etc. I get the links out of the source code by doc.Links
Before the source-code is being downloaded I'm checking if the site is completely loaded. I perform this check by the following code:
While ((doc.readyState <> "complete"))
DoEvents
Wend
With hundreds of websites this is working correct, but several websites doesn't give a 'Complete'-status back. So i started to search for a solution which could fix this and added the following code:
Start = Timer
While ((doc.readyState <> "complete"))
If ((Timer - Start) > 30) Then
' Voer actie uit
Else
DoEvents
End if
Wend
So after 30 seconds the script would continue, but strangly enough several websites like these:
- f1pits.net
- fr-fans.nl
Keep giving problems, as soon as the script reaches
While ((doc.readyState <> "complete"))
Excel crashes completely and needs to be restarted, do you have any idea how i could fix this?
Thanks a lot!
Regards Yannick