some exotic error

G

God Itself

how to fix something like that:

Sub getquery()
a =
"URL;http://www.bankier.pl/inwestowanie/...FI-jednostkowy-raport-kwartalny.html?offset=0"
b = "any_name_01"
With Sheets("query").QueryTables.Add(Connection:=a,
Destination:=Sheets("query").Range("A1"))
.Name = b
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False 'ERROR LINE ???
End With
End Sub

and error sounds:

Run-time error '-2147417848 (80010108)'
Automation Error
The object invoked has disconnected from its client.
 
G

God Itself

Macro is ok, i know that

but try use it in real file and create a web query..

anyway - how can i download data in spite of server-side problem?

i posted today this problem but from other view:

"Web query causes excel crash!"
 
J

Joel

You'll always get the error on the .REFRESH line because the Query is not
processed until you get to this line.

There is an error on the webpage and it is not caused by your code. You can
see what I mean by going to the excel worksheet menu

Data - Import External Data - New Web Query.

Then enter your URL in the address box and press OK. You'll get errors and
excel will crash.
 
J

Jim Thomlinson

I'm still unclear. So the macro is ok but the server is not responding. You
want the macro to get data anyway? That is like wanting to have a
conversation with someone who will not answer the phone. If the server will
not answer what would you like the macro to do???
 
D

Don Guillett

I answered this for him privately with a workbook. Problem is that the site
would not allow all tables or that one. Only tables 2,3,4,5,6,9
This question was after I sent the code below with table 9. OP changed to
1....... BANG!! Some just won't take NO for an answer.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top