Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Web query. Rejected by server after 7 updates... Way around?

Hi!

Im querying a web server trough the excel web query. All is wright expect
for the fact tha the web server rejects my query after 7 updates. After that
i have to to shutdown excel and restarts again to have be able to update
again.
(The information that im accessing is public and im careful not to
overwhelm the web server).

Is there a way around this problem? does excel keeps the connection alive,
and there for creates this problem? is there a way to REALLY kill the
connection to the server? im totally new at this web query stuff....

Thanks a lot
Speed
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Web query. Rejected by server after 7 updates... Way around?

Hi don

Sorry for the delayed reply.
My code is the following. If you run it 7 times the server rejects the
query, i have to restart excel do continue to query the server. I have about
15 querys like this i would like to run every day.

What happens when i close excel? does excel keeps any kind of connection
open??

WEB
1
http://publicacoes.mj.pt/pt/pesquisa...oncelh oDesc=

Selection=EntirePage
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False


"Don Guillett" wrote:


More info such as the url and the method used.
If desired, send your wb to my address below along with a snippet of this
msg.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SpeeD" wrote in message
...
Hi!

Im querying a web server trough the excel web query. All is wright expect
for the fact tha the web server rejects my query after 7 updates. After
that
i have to to shutdown excel and restarts again to have be able to update
again.
(The information that im accessing is public and im careful not to
overwhelm the web server).

Is there a way around this problem? does excel keeps the connection alive,
and there for creates this problem? is there a way to REALLY kill the
connection to the server? im totally new at this web query stuff....

Thanks a lot
Speed



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Web query. Rejected by server after 7 updates... Way around?

I tried yours and had no problem. As I said, send your wb and I will test.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SpeeD" wrote in message
...
Hi don

Sorry for the delayed reply.
My code is the following. If you run it 7 times the server rejects the
query, i have to restart excel do continue to query the server. I have
about
15 querys like this i would like to run every day.

What happens when i close excel? does excel keeps any kind of connection
open??

WEB
1
http://publicacoes.mj.pt/pt/pesquisa...oncelh oDesc=

Selection=EntirePage
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False


"Don Guillett" wrote:


More info such as the url and the method used.
If desired, send your wb to my address below along with a snippet of this
msg.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SpeeD" wrote in message
...
Hi!

Im querying a web server trough the excel web query. All is wright
expect
for the fact tha the web server rejects my query after 7 updates. After
that
i have to to shutdown excel and restarts again to have be able to
update
again.
(The information that im accessing is public and im careful not to
overwhelm the web server).

Is there a way around this problem? does excel keeps the connection
alive,
and there for creates this problem? is there a way to REALLY kill the
connection to the server? im totally new at this web query stuff....

Thanks a lot
Speed




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Web query. Rejected by server after 7 updates... Way around?

Using this, I got 12 before having to exit excel and start over.

Sub getdata()
counter = 0
Do Until counter = 20
With Sheets("sheet1").QueryTables(1)
.Connection = _
"URL;http://publicacoes.mj.pt/pt/pesquisa.asp?iNIPC=" & _
"&sFirma=&dfDistrito=11&dfConcelho=06&dInicial=200 9-04-09" & _
"&dFinal=2009-04-10&iTipo=1&sCAPTCHA=" & _
"&pesquisar=Pesquisar&dfConcelhoDesc"
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
counter = counter + 1
If Sheets("sheet1").Range("a10") = "Erro" Then
MsgBox "Failed at " & counter
Exit Sub
End If
Loop

End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
I tried yours and had no problem. As I said, send your wb and I will test.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SpeeD" wrote in message
...
Hi don

Sorry for the delayed reply.
My code is the following. If you run it 7 times the server rejects the
query, i have to restart excel do continue to query the server. I have
about
15 querys like this i would like to run every day.

What happens when i close excel? does excel keeps any kind of connection
open??

WEB
1
http://publicacoes.mj.pt/pt/pesquisa...oncelh oDesc=

Selection=EntirePage
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False


"Don Guillett" wrote:


More info such as the url and the method used.
If desired, send your wb to my address below along with a snippet of
this
msg.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SpeeD" wrote in message
...
Hi!

Im querying a web server trough the excel web query. All is wright
expect
for the fact tha the web server rejects my query after 7 updates.
After
that
i have to to shutdown excel and restarts again to have be able to
update
again.
(The information that im accessing is public and im careful not to
overwhelm the web server).

Is there a way around this problem? does excel keeps the connection
alive,
and there for creates this problem? is there a way to REALLY kill the
connection to the server? im totally new at this web query stuff....

Thanks a lot
Speed




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
Excel with SQL Query (*.sql) and SQL Server Kode Excel Discussion (Misc queries) 2 May 8th 07 01:10 PM
Change order of query updates ste1000 Excel Discussion (Misc queries) 1 October 17th 06 05:00 PM
Query SQL Server Kevin L Excel Programming 1 November 30th 04 09:11 PM
Query Hangs or Slow Performance after 2 updates Malcolm Excel Programming 3 February 20th 04 09:47 PM
Copy Data (Sheet2 to Sheet1) Updates Web Query JStone0218 Excel Programming 0 October 9th 03 02:07 AM


All times are GMT +1. The time now is 07:35 AM.

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"