when i disable internet connection to try the error procedure instead of doing the line related to the error the macro show a message error ; can someone tell where the error is thanks .i've added 2 attachments too to see what happens when i push F8.
Workbooks.Add.Activate
ActiveWorkbook.SaveAs Filename:="C:\documenti1\documenti2\FONDI1\downloaded_etf"
Sheets("Foglio1").Activate
Sheets("Foglio1").Name = "dati etf"
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:
.Refresh BackgroundQuery:=False
'On Error Resume Next
On Error GoTo Etichetta
End With
Bookmarks