Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3210784
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:37:11+00:00 2026-05-17T14:37:11+00:00

Why does the following code give a 80004005 error when run? I’m trying to

  • 0

Why does the following code give a 80004005 error when run? I’m trying to get the status of several sites every 10 seconds…(the ones given are examples).

'http://www.sebsworld.net/information/?page=VBScript-URL
'http://www.paulsadowski.com/wsh/xmlhttp.htm

'the array of sites
sites = Array("http://www.google.com/","http://en.wikipedia.org/wiki/Main_Page")

While(True)
    For Each site In sites

        'Get site status
        Set Http = WScript.CreateObject("Microsoft.XMLHTTP")
        Http.Open "GET", site, True
        Http.Send

        If(Http.Status <> 200) Then 'site isn't 200
            MsgBox "The site at " & vbNewLine & site & vbNewLine & "has status: " & Http.Status
        End If
    Next

    WScript.Sleep(10)'Sleep 10 seconds
Wend
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:37:11+00:00Added an answer on May 17, 2026 at 2:37 pm

    First, you have to change

    Http.Open "GET", site, True 
    

    to

    Http.Open "GET", site, False
    

    because you cannot use Http.Status immediately after Http.Send if the call is asynchronous.

    Furthermore, you shoud use

    Set Http = WScript.CreateObject("MSXML2.ServerXMLHTTP") 
    

    instead of

    Set Http = WScript.CreateObject("Microsoft.XMLHTTP")
    

    because the normal XMLHTTP object has problems with redirected web sites (www.google.com normally redirects you to another site).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does the following code give me an error (g++ 4.1.2)? template<class A> class
Why does the following code get the runtime error: Members of the Triggers collection
Why does the following code not give me a duplicate symbol linker error for
Why does the following code NOT give an error, nor any type of a
Why does the following code give me a segmentation fault? #define MAXROWS 10 #define
The following code does not give a warning with g++ 4.1.1 and -Wall .
Why does following code snippet doesn't work? It doesn't gives any error, but also
The following code will give a hard fail when run under Windows 7 32bit:
Why does the following code give 'None'? How can I resolve this? def f1(list1):
In the following code, why does 2 give output but not 3? The removechars

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.