VBA IExplorer get status

Discussion in 'Internet Explorer' started by Jürgen Meyer, May 19, 2013.

  1. I want to check whether a website exists or not.
    I already have seen the following method:

    Set opjApp = CreateObject("MSXML2.XMLHTTP")
    With objApp
    strRequest = strurl & strAddress
    .Open strRequest, False
    .send
    If .status = 200 Then …

    But I want to do a different thing:

    Set objApp = CreateObject("InternetExplorer.Application")
    With objApp
    .navigate url:="http://goo.gl/maps/fbsS33"

    How to get the status at this point?

    I do not talk about
    ..Busy or .ReadyState
    ReadyState only checks whether a website has been loaded completely or not.

    Regards
    Juergen
     
    Jürgen Meyer, May 19, 2013
    #1
    1. Advertisements

  2. Jürgen Meyer

    Mayayana Guest

    If you have a method that works then why do
    you need another? IE is not really designed to
    give you access to the server conversation. What
    if you get a 302 redirect instead of a 200? You'd
    never know that. IE takes care of it transparently.
    Or you could get a 404 that redirects you to a custom
    error page. You'd get a 200 on that page and load an
    apparently valid webpage, but it would really be a
    404. I think the only way to check in IE would be
    to wait for document_complete and then check for
    the document content you're expecting.

    |I want to check whether a website exists or not.
    | I already have seen the following method:
    |
    | Set opjApp = CreateObject("MSXML2.XMLHTTP")
    | With objApp
    | strRequest = strurl & strAddress
    | .Open strRequest, False
    | .send
    | If .status = 200 Then .
    |
    | But I want to do a different thing:
    |
    | Set objApp = CreateObject("InternetExplorer.Application")
    | With objApp
    | .navigate url:="http://goo.gl/maps/fbsS33"
    |
    | How to get the status at this point?
    |
    | I do not talk about
    | .Busy or .ReadyState
    | ReadyState only checks whether a website has been loaded completely or
    not.
    |
    | Regards
    | Juergen
     
    Mayayana, May 19, 2013
    #2
    1. Advertisements

  3. Thanks for the answer.
    Good arguments, but:

    I call the IExplorer invisible to retrieve some information from a website
    automatically and to store it in a database.
    So the program needs some feedback to cancel the call if the operation was not
    successful.

    Juergen
     
    Jürgen Meyer, May 19, 2013
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.