Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

excel et webbrowser

4 réponses
Avatar
steph b
bonjour voici mon code
Sub Traitement()
Dim TabTemp As Variant
Dim L As Long, L2 As Long, Lign As Long
Dim Col As Byte

With Sheets("Feuil1")
'On affiche la page Web dans le WebBrowser
EnCours = True
.WebBrowser1.Navigate .Cells(1, 1).Text
'Le flag "EnCours" est remis à False dans Feuil1 >
WebBrowser1_DocumentComplete()
Do
DoEvents
Loop Until EnCours = False

End Sub

ce code ouvre une page web dans un webbrowser su une feuille nommé feuil1

dans cette page je dois mettre un mot de passe et un login
comment fait on pour saisir par vba ce password et login?

merci beaucoup

4 réponses

Avatar
MichD
Bonjour,

à cette adresse, il y a cette procédure :
dis-nous si cela fonctionne ?
http://www.bigresource.com/VB-Webbrowser-password-save-6LYRY9n41A.html#lEOxi7zkyl


Post Password With WebBrowser.Navigate
I want to open a html page using http and post the user name and password. I am thinking about using the WebBrower
Navigate object.

I found the following code in MS knowledge Base. It works good for input fields with type=text, but it don't work for
type=password. Does someone have a workaround for this problem?


Code:
'-------------------------------------------------
Sub Command1_Click()
Dim URL As String
Dim Flags As Long
Dim TargetFrame As String
Dim PostData() As Byte
Dim Headers As String

URL = "http://YourServer" ' A URL that will accept a POST
Flags = 0
TargetFrame = ""

PostData = "UserName=MyName&Password=MyPassword"

' VB creates a Unicode string by default so we need to
' convert it back to Single byte character set.
PostData = StrConv(PostData, vbFromUnicode)

Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrlf
WebBrowser1.Navigate URL, Flags, TargetFrame, PostData, Headers
End Sub
'-------------------------------------------------



MichD
--------------------------------------------
"steph b" a écrit dans le message de groupe de discussion : 4db0269f$0$32463$

bonjour voici mon code
Sub Traitement()
Dim TabTemp As Variant
Dim L As Long, L2 As Long, Lign As Long
Dim Col As Byte

With Sheets("Feuil1")
'On affiche la page Web dans le WebBrowser
EnCours = True
.WebBrowser1.Navigate .Cells(1, 1).Text
'Le flag "EnCours" est remis à False dans Feuil1 >
WebBrowser1_DocumentComplete()
Do
DoEvents
Loop Until EnCours = False

End Sub

ce code ouvre une page web dans un webbrowser su une feuille nommé feuil1

dans cette page je dois mettre un mot de passe et un login
comment fait on pour saisir par vba ce password et login?

merci beaucoup
Avatar
steph b
NON Mich D


ca plante
a la derniere ligne erreur 424

"MichD" a écrit dans le message de news:
iop9uf$6h1$
Bonjour,

à cette adresse, il y a cette procédure :
dis-nous si cela fonctionne ?
http://www.bigresource.com/VB-Webbrowser-password-save-6LYRY9n41A.html#lEOxi7zkyl


Post Password With WebBrowser.Navigate
I want to open a html page using http and post the user name and password.
I am thinking about using the WebBrower
Navigate object.

I found the following code in MS knowledge Base. It works good for input
fields with type=text, but it don't work for
type=password. Does someone have a workaround for this problem?


Code:
'-------------------------------------------------
Sub Command1_Click()
Dim URL As String
Dim Flags As Long
Dim TargetFrame As String
Dim PostData() As Byte
Dim Headers As String

URL = "http://YourServer" ' A URL that will accept a POST
Flags = 0
TargetFrame = ""

PostData = "UserName=MyName&Password=MyPassword"

' VB creates a Unicode string by default so we need to
' convert it back to Single byte character set.
PostData = StrConv(PostData, vbFromUnicode)

Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrlf
WebBrowser1.Navigate URL, Flags, TargetFrame, PostData, Headers
End Sub
'-------------------------------------------------



MichD
--------------------------------------------
"steph b" a écrit dans le message de groupe de discussion :
4db0269f$0$32463$

bonjour voici mon code
Sub Traitement()
Dim TabTemp As Variant
Dim L As Long, L2 As Long, Lign As Long
Dim Col As Byte

With Sheets("Feuil1")
'On affiche la page Web dans le WebBrowser
EnCours = True
.WebBrowser1.Navigate .Cells(1, 1).Text
'Le flag "EnCours" est remis à False dans Feuil1 >
WebBrowser1_DocumentComplete()
Do
DoEvents
Loop Until EnCours = False

End Sub

ce code ouvre une page web dans un webbrowser su une feuille nommé feuil1

dans cette page je dois mettre un mot de passe et un login
comment fait on pour saisir par vba ce password et login?

merci beaucoup

Avatar
MichD
Je n'ai pas d'adresse avec laquelle je peux tester !



MichD
--------------------------------------------
Avatar
steph b
en fait le site peut etre variable
prenons par exemple le site de société generale
https://particuliers.societegenerale.fr/




"MichD" a écrit dans le message de news:
iopekv$if9$
Je n'ai pas d'adresse avec laquelle je peux tester !



MichD
--------------------------------------------