Simply
XLDnaute Occasionnel
Bonjour à tous nous allons voir si quelqu'un peut me aider dans cette entreprise.
Je besoin de télécharger le fichier Excel à partir du site:
h t t p://it.investing.com/commodities/brent-oil-historical-data
Je me demande si vous pouvez changer les dates pour récupérer tout ce à partir du site historique
Voici le code créé
	
	
	
	
	
		
Merci
	
		
			
		
		
	
				
			Je besoin de télécharger le fichier Excel à partir du site:
h t t p://it.investing.com/commodities/brent-oil-historical-data
Je me demande si vous pouvez changer les dates pour récupérer tout ce à partir du site historique
Voici le code créé
		Code:
	
	
	Option Explicit
Sub Macro1()
    Dim i As Long
    Cells.Select
    For i = 1 To ActiveSheet.QueryTables.Count
      ActiveSheet.QueryTables(i).Delete
    Next i
    Selection.ClearContents
    
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://it.investing.com/commodities/brent-oil-historical-data", _
        Destination:=Range("$A$1"))
'        .CommandType = 0         'Disabilitare
        .Name = "brent-oil-historical-data"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = False
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        '------------------------------------
        .WebSelectionType = xlSpecifiedTables
        .WebTables = "3,4"
        '------------------------------------
        .WebFormatting = xlWebFormattingAll
        .WebPreFormattedTextToColumns = False
        .WebConsecutiveDelimitersAsOne = False
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
End Sub
	Merci
	