voilà je cherche a passer la fenetre de login et password pour acceder
directement a la page reglage et en prnedre le code source sur une feuille
excel
j'ai utilisé le code source suivant mais je ne sais pas comment faire pour
passer la 1er fenetre
loggin : test
password 1234
code
Private Declare Function OuvreInternet Lib "wininet" _
Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As
Long, _
ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags
As Long) As Long
Private Declare Function fermeInternet Lib "wininet" _
Alias "InternetCloseHandle" (ByVal hInet As Long) As Integer
Private Declare Function code_page Lib "wininet" _
Alias "InternetReadFile" (ByVal hFile As Long, ByVal sBuffer As String,
_
ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Private Declare Function Ouvrepage Lib "wininet" _
Alias "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl
As String, _
ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal
dwFlags As Long, _
ByVal dwContext As Long) As Long
Sub lit_code_page_Web()
Dim texte_code As String * 1024
Dim url_page As String
Application.DisplayAlerts = False
Sheets("visu").Delete
url_page =
"http://www.virtualtransat.com/vt/login_participant.php?no=e7954bd116390156203fb5db2404cebd"
'ouvre Internet
internet = OuvreInternet("toto", 0, vbNullString, vbNullString, 0)
'ouvre la page Web
URL = Ouvrepage(internet, url_page, vbNullString, 0, &H400000 Or &H4000000
Or &H80000000, 0)
'lecture du code de la page par paquet de 1024 caractères
txt = ""
nb_caractères_lus = 1
Do While nb_caractères_lus > 0
'lit 1024 caractères et les copie dans texte_code
code_page URL, texte_code, 1024, nb_caractères_lus
txt = txt & Left(texte_code, nb_caractères_lus)
Loop
'ferme la page
fermeInternet URL
'ferme Internet
'fermeInternet internet
'MsgBox txt
'recopie dans un fichier texte
Open "c:\code source.txt" For Output As #1
Print #1, txt
Close #1
'ouverture du fichier téléchargé dans excel
lien = "TEXT;c:\code source.txt"
'ouvre la feuille visu
Sheets.Add.Name = "visu"
With ActiveSheet.QueryTables.Add(Connection:=lien,
Destination:=Range("A1"))
.AdjustColumnWidth = False
.TextFileTabDelimiter = False
'.TextFileOtherDelimiter = "="
.Refresh BackgroundQuery:=False
End With
'detruit le fichier texte
Kill "c:\code source.txt"
Application.DisplayAlerts = True
End Sub
merci pour vos réponses et Bon Noël à tous et toutes