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. Advertising

  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.

    "Jürgen Meyer" <> wrote in message
    news:...
    |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. Advertising

  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

    On Sun, 19 May 2013 09:12:47 -0400, "Mayayana" <>
    wrote:

    > 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.
    >
    >"Jürgen Meyer" <> wrote in message
    >news:...
    >|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
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. EdH

    VBA and Vista compatibility issues

    EdH, Mar 14, 2007, in forum: Windows Vista General Discussion
    Replies:
    3
    Views:
    257
    Mark Rae
    Mar 14, 2007
  2. Rod

    VBA run-time error 3170: Could not find installable ISAM

    Rod, Apr 3, 2007, in forum: Windows Vista General Discussion
    Replies:
    0
    Views:
    571
  3. Tech_vs_Life

    Timer event failing sporadically -- Office 2007 VBA

    Tech_vs_Life, Apr 17, 2007, in forum: Windows Vista General Discussion
    Replies:
    4
    Views:
    235
    Allen Browne
    Jul 2, 2007
  4. SlicerRod

    VBA Function not recognized in Excel

    SlicerRod, Jan 4, 2008, in forum: Windows Vista General Discussion
    Replies:
    3
    Views:
    171
    SlicerRod
    Jan 4, 2008
  5. FPS, Romney

    VBA FileCopy hangs with UAC

    FPS, Romney, Jul 11, 2008, in forum: Windows Vista Security
    Replies:
    6
    Views:
    267
    FPS, Romney
    Jul 14, 2008
Loading...

Share This Page