bonjour nr,
je travaille sur ce sujet depuis un moment.
exemple de téléchargement réalisé avec l'aide des spécialistes
excel-download :
http://www.actionfuture.com/fichiers/portefeuille.zip
tu vas dans vba project- macro "Telecharge"
pôur que ça fonctionne,
il est nécessaire d'installer l'utilitaire d'analyse en macro complémentaire pour calculer les matrices variances-covariances et matrices de corrélations
- téléchargement : il faut s'inscrire préalablement sur boursorama
http://www.boursorama.com/non_enregistre.phtml
cocher la case « mémoriser » sinon le téléchargement échouera ...
Sub Macro2()
'
' Macro enregistrée le 02/09/2003 par Cyber PAPY
'http://perso.wanadoo.fr/cyberpapy/index.htm
'--------dat la période d'analyse contenue dans la cellule F 9 -------------------------------
Sheets("cours").Select
Range("A1:EA250").Select
Selection.ClearContents
Sheets("rendement").Select
Range("A1:EA250").Select
Selection.ClearContents
Sheets("feuil1").Select
Range("K2:N250").Select
Selection.ClearContents
Sheets("statistiques").Select
Range("A21:Z250").Select
Selection.ClearContents
Sheets("feuil1").Select
Range("A2:C20000").Select
Selection.ClearContents
Cells(1, 5) = 0
For n = 0 To 1
Cells(2, 5) = n ' nombre de périodes
dat = Cells(9, 6)
'--------------------Indice CAC 40--------------------
A = "http://www.boursorama.com/outils/telechargement/telechargement.phtml?hid_date=ok&SELECT_PORT=Tous&MARCHE=SICOVAM&CODE=350000&A_LIBELLE=0&A_SICO=1&A_DATE=1&A_CLOT=1&"
D = "FILE_FORMAT=LIBRE&ISINY=n&download=T%E9l%E9charger"
C = "a" & n * 3000 + 2
GoSub import
'--------------SBF 120-------------
A = "http://www.boursorama.com/outils/telechargement/telechargement.phtml?hid_date=ok&MARCHE=SBF120&SELECT_PORT=Tous&CODE=&A_SICO=1&A_DATE=1&A_CLOT=1&"
C = "a" & n * 3000 + 30
GoSub import
Cells(1, 5) = n + 1
Next
End
import:
Sheets("feuil1").Select
url = "url;" & A & dat & D
Debug.Print url
'-------requete qui importe les données du mois les unes au dessous des autres sur la page-----------
With ActiveSheet.QueryTables.Add(Connection:=url, Destination:=Range(C))
.Name = "histo"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
Return
Sheets("Feuil1").Select
Range("A:C").Select
Selection.Sort Key1:=Range("b2"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A:C").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("F1:F2"), CopyToRange:=Range("G1"), Unique:=True
Range("g1:g250").Select
Selection.Sort Key1:=Range("g2"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
UserForm1.Show
End Sub
on peut faire le même exercice sur yahoo
tout fait :
http://webpage.pace.edu/mkishinevsky/software/
en particulier :
http://webpage.pace.edu/mkishinevsky/software/hmdr-20021112.xls
ce sont des bases à adapter à tes besoins
albert