View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default some exotic error

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.



"God Itself" wrote:

how to fix something like that:

Sub getquery()
a =
"URL;http://www.bankier.pl/inwestowanie/profile/wynikifinansowe/01NFI-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.