Bonjour ,
J'ai trouvé dans le forum, ce code
https://forum.excel-pratique.com/recherche/boursorama?d=eyJtYyI6ImJvdXJzb3JhbWEiLCJhIjoiIiwiZiI6IjAi...
qui me pose quelques soucis ! j'utilise excel 2007.
les valeurs transmises dans les cellules ne représentent que la valeur entière et oubli la parti décimale
en faisant du pas a pas dans la macro je vois bien qu'il n'y a que la partie entière sans la virgule
j'ai bien trouvé une solution pour MajCotations() et Haut()
Sub MajCotations()
Dim i%, k%, URL$, COT
k = Range("B" & Rows.Count).End(xlUp).Row
Range(Cells(k, 1), Cells(k, 1)).Clear
avant = """price"":"
apres = ",""priceCurrency"
On Error Resume Next
For i = 4 To k
DoEvents
ReDim COT(1 To k, 1 To 1)
COT(1, 1) = Cells(i, [Cotation].Column).Value
Test = COT(1, 1)
URL = Cells(i, [WWW].Column).Value
Application.StatusBar = "Mise à jour des cotations en cours …"
On Error Resume Next
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", URL, False
.send
If .Status = 200 Then COT(i, 1) = Split(Split(.responseText, avant)(1), apres)(0)
End With
Application.StatusBar = False
Test = COT(i, 1)
Cells(i, [Cotation].Column).Value = COT(i, 1)
Next
End Sub
Sub Haut()
Dim i%, k%, URL$, Haut_Max
Dim avant As String
Dim apres As String
k = Range("B" & Rows.Count).End(xlUp).Row
Range(Cells(k, 1), Cells(k, 1)).Clear
avant = "","high":" '"quot;high":"
apres = ","
On Error Resume Next
For i = 4 To k
DoEvents
ReDim Haut_Max(1 To k, 1 To 1)
Haut_Max(1, 1) = Cells(i, [Plus_haut].Column).Value
URL = Cells(i, [WWW].Column).Value
Application.StatusBar = "Mise à jour des cotations en cours …"
On Error Resume Next
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", URL, False
.send
Test = Val(Split(Split(.responseText, avant)(1), apres)(0))
Test = Replace(Test, ",", ".")
If .Status = 200 Then Haut_Max(i, 1) = Test 'Val(Split(Split(.responseText, avant)(1), apres)(0))
End With
Application.StatusBar = False
Test = Haut_Max(i, 1)
Cells(i, [Plus_haut].Column).Value = Haut_Max(i, 1)
Next
End Sub
mais je ne trouve aucune solution pour le reste, peut-être quelqu'un sur le forum aura une solution