thank for your help ; but there is still some problem when there is no connection it enter Etichetta1:
and give me the same error ; with connection evrything is ok
Sub IN_LAVORAZIONE()
Dim cont As Byte
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.borsaitaliana.it/bitApp/listino?service=Data&lang=it&main_list=11&sub_list=2" _
, Destination:=ActiveCell)
.Name = "listino?service=Data&lang=it&main_list=11&sub_list=2"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "6,7,8"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
Etichetta1:
On Error GoTo Etichetta
.Refresh BackgroundQuery:=False
On Error GoTo 0
End With
Exit Sub
Etichetta:
CreateObject("WScript.Shell").Popup "nuovo tentativo: " & cont & " di 60 tra 5 secondi", 1, "errore nello scaricare i dati"
Sleep 5000
cont = cont + 1
If cont = 60 Then
MsgBox "PROBLEMA SULLA RETE INTERNET impossibile scaricare i dati"
End If
GoTo Etichetta1
End Sub
Bookmarks