Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Web Query error returns

Hi Peter,

In Excel, try:

Data | Get External Data


---
Regards,
Norman


"Peter" wrote in message
ups.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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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" wrote in message
ups.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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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" wrote in message ups.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" wrote in message
ups.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
web query url returns data, but not showing Richard S[_2_] Excel Discussion (Misc queries) 0 April 30th 09 04:29 PM
web query returns no data Gary Excel Programming 6 April 11th 06 09:52 PM
query only returns numeric - can I get characters ... ? Hajime Kusakabe Excel Programming 2 May 11th 05 03:09 PM
Query that returns a value to variable mas Excel Programming 0 March 7th 05 09:22 PM
DAO query/recordset returns with field names Seth[_4_] Excel Programming 0 August 18th 03 08:36 PM


All times are GMT +1. The time now is 05:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"