+ Reply to Thread
Results 1 to 4 of 4

Web Query error returns

Hybrid View

  1. #1
    Peter
    Guest

    Web Query error returns

    I am initiating a web query from VBA.

    If the query fails I get an error which I can catch - all fine.

    BUT

    It allways returns 1004!!

    Does anybody know how to detect the difference between, say,

    cannot access internet at all
    cant access that particular server
    http status code (400, 404, 500 etc)

    I am using XL2003


  2. #2
    Norman Jones
    Guest

    Re: Web Query error returns

    Hi Peter,

    In Excel, try:

    Data | Get External Data


    ---
    Regards,
    Norman


    "Peter" <pd@p4pi.com> wrote in message
    news:1152780513.235971.317630@35g2000cwc.googlegroups.com...
    >I am initiating a web query from VBA.
    >
    > If the query fails I get an error which I can catch - all fine.
    >
    > BUT
    >
    > It allways returns 1004!!
    >
    > Does anybody know how to detect the difference between, say,
    >
    > cannot access internet at all
    > cant access that particular server
    > http status code (400, 404, 500 etc)
    >
    > I am using XL2003
    >




  3. #3
    Peter
    Guest

    Re: Web Query error returns

    Hi
    - Yes data/get external data shows you on an IE window what happens.

    My question is, when creating a web query programatically (using VBA)
    how does one
    discriminate between the different possible errors.


    Peter

    Norman Jones wrote:
    > Hi Peter,
    >
    > In Excel, try:
    >
    > Data | Get External Data
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Peter" <pd@p4pi.com> wrote in message
    > news:1152780513.235971.317630@35g2000cwc.googlegroups.com...
    > >I am initiating a web query from VBA.
    > >
    > > If the query fails I get an error which I can catch - all fine.
    > >
    > > BUT
    > >
    > > It allways returns 1004!!
    > >
    > > Does anybody know how to detect the difference between, say,
    > >
    > > cannot access internet at all
    > > cant access that particular server
    > > http status code (400, 404, 500 etc)
    > >
    > > I am using XL2003
    > >



  4. #4
    Tim Williams
    Guest

    Re: Web Query error returns

    Depending on your coding skills you could always do a "head" request using an XMLHTTP object before running the web query, or even
    perform the whole query using that method (depends on how complex the returned page is).

    That will at least filter out the 404's etc and give you a readable error.

    --
    Tim Williams
    Palo Alto, CA


    "Peter" <pd@p4pi.com> wrote in message news:1152795574.811557.41690@i42g2000cwa.googlegroups.com...
    > Hi
    > - Yes data/get external data shows you on an IE window what happens.
    >
    > My question is, when creating a web query programatically (using VBA)
    > how does one
    > discriminate between the different possible errors.
    >
    >
    > Peter
    >
    > Norman Jones wrote:
    > > Hi Peter,
    > >
    > > In Excel, try:
    > >
    > > Data | Get External Data
    > >
    > >
    > > ---
    > > Regards,
    > > Norman
    > >
    > >
    > > "Peter" <pd@p4pi.com> wrote in message
    > > news:1152780513.235971.317630@35g2000cwc.googlegroups.com...
    > > >I am initiating a web query from VBA.
    > > >
    > > > If the query fails I get an error which I can catch - all fine.
    > > >
    > > > BUT
    > > >
    > > > It allways returns 1004!!
    > > >
    > > > Does anybody know how to detect the difference between, say,
    > > >
    > > > cannot access internet at all
    > > > cant access that particular server
    > > > http status code (400, 404, 500 etc)
    > > >
    > > > I am using XL2003
    > > >

    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1