Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access web pages with HTTPS thru VBA Excel???

Status
Not open for further replies.

tarvel

Technical User
Nov 21, 2005
8
FR
I'm trying to access web pages with HTTPS and that require login/password. Is this possible thru VBA Excel???
 


Hi,

Is there an ID & PW in the URL Connect String?

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
I give you a part on source code...javascript seems...

<td><span class="txt12noir">Identifiant</span><span
class="txt11gris"></span><br><font size="1"><input type="text" name="ID"
size="25" maxlength=11 value="" onKeyDown="CtrlEvt();"
class="box"></font></td>
<td><span class="txt12noir">Mot de passe</span><span
class="txt11gris"></span><br><font size="1"><input type="password"
name="PWD" maxlength=6 size="25" value="" onKeyDown="CtrlEvt();"
class="box"></font></td>
<td valign="bottom"><a href="JavaScript:Controle();">
<img
src="/images/commun/ident_ok.gif" border="0" width="25" height="18"
alt="Valider"></a></td>

 
This code Source Code come from Url https...How can i write ID and password...and validate by click...by using VBA???
Thanks for your help!!!
 
Code:
    s = "<td><span class=""txt12noir"">Identifiant</span><span"
    s = s & "class=""txt11gris""></span><br><font size=""1""><input type=""text"" name=""ID"""
    s = s & "size=""25"" maxlength=11 value="""" onKeyDown=""CtrlEvt();"""
    s = s & "class=""box""></font></td>"
    s = s & "<td><span class=""txt12noir"">Mot de passe</span><span"
    s = s & "class=""txt11gris""></span><br><font size=""1""><input type=""password"""
    s = s & "name=[red]"" & [b]MyPassword[/b] & ""[/red] maxlength=6 size=""25"" value="""" onKeyDown=""CtrlEvt();"""
    s = s & "class=""box""></font></td>"
    s = s & "<td valign=""bottom""><a href=""JavaScript:Controle();"">"
    s = s & "<img"
    s = s & "src=""/images/commun/ident_ok.gif"" border=""0"" width=""25"" height=""18"""
    s = s & "alt=""Valider""></a></td>"

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
I let the VBA driver for webpage...work fine with http...but nothing with https...have you a soluce??
link for the website : and the vba here...thanks for your help!!!

Sub webVBA()
Dim Identifiant As String
Dim Pass As String
Dim objet As IHTMLElementCollection
Dim i As Integer
Dim x As Integer
Dim Doc As HTMLDocument
Set IE = CreateObject("internetExplorer.Application")
IE.Visible = True
'activate Microsoft HTML Objects Library
'activate Microsoft Internet Controls
IE.navigate " 'see webpage in test.rar
Do Until IE.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set Doc = IE.document
For x = 0 To Doc.Links.Length - 1
Cells(x + 1, 1) = Doc.Links(x)
Next
Set PageHtml = IE.document
Set objet = PageHtml.getElementsByTagName("input")
Dim i As Integer
'msgbox for each objet "input"
For i = 0 To objet.Length - 1
MsgBox objet(i).getAttribute("name") & " / " & objet(i).getAttribute("value")

Identifiant = "xxxxxx"
Pass = *****
'write ID et PAss on Webpage ...in (1) or (2) or (n) input...but nothing appears???
objet(n).innerText = Identifiant
objet(n).innerText = pass

'after i search a submit (validate"???...in position links n...but result nothing in https web site!!!
Set Cible = Doc.Links(n)
Application.Wait Now + TimeValue("00:00:01")
Cible.Click
end sub()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top