Solved

VB WebBrowser Frames Login problem

Posted on 2004-10-29
650 Views
Last Modified: 2013-12-26
I'm Trying to automate a Login Proccess with WebBrowser Control. The web is www.aag.com.ar/clubes. The problem is that when I go to: IE.navigate "www.aag.com.ar/clubes" there is no "txtUsuario" field to fill. But if I go to IE.navigate "www.aag.com.ar/clubes/editorial.asp" I find it. The problem is that if I do the last option when I "click" on the Log In Link, it does nothing. It's like www.aag.com.ar/clubes is divided in Frames, but i check out this and only 2 frames appear. The Login Frame is not appearing. How can i handle this problem?
0
Question by:Ezes
    7 Comments
     
    LVL 14

    Expert Comment

    by:Shiju Sasidharan
    Hi
    First u navigate to
    www.aag.com.ar/clubes
    Whet this document gets completed try to navigage
    www.aag.com.ar/clubes/editorial.asp
    and after this Document is Loaded completely , "click" on the Log In Link

    ;-)
    Shiju
    0
     

    Author Comment

    by:Ezes
    I tried that by doing the following:
    Ie.navigate "www.aag.com.ar/clubes"
    on the Document_Complete: I use another control IE2 by:
    IE2.navigate "www.aag.com.ar/clubes/editorial.asp" and
    Set htmlelement = IE2.document.All.Item("txtUsuario")
    htmlelement.Value = "C110GF"
    Set htmlelement = IE2.document.All.Item"txtPassword")
    htmlelement.Value = "C110GF"
    Set htmlelement = IE2.document.links.Item(0)
    htmlelement.Click

    But still doesn´t work...
    0
     
    LVL 17

    Expert Comment

    by:zzzzzooc
    editorial.asp is within 2 different framesets (/   ->   /frahome.asp   ->  /editorial.asp).

    Private Sub Command1_Click()
        Dim objDoc As Object
        Call WebBrowser1.Navigate("http://www.aag.com.ar/clubes/")
        Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
            DoEvents
        Loop
        'http://www.aag.com.ar/clubes/
        Set objDoc = WebBrowser1.Document
        'http://www.aag.com.ar/clubes/frahome.asp
        Set objDoc = objDoc.frames(1).Document
        'http://www.aag.com.ar/clubes/editorial.asp
        Set objDoc = objDoc.frames(1).Document
        'fill in form
        objDoc.frmLogin.txtUsuario.Value = "user?"
        objDoc.frmLogin.txtPassword.Value = "pass?"
        'submit form...
        Call objDoc.frmLogin.submit
    End Sub
    0
     

    Author Comment

    by:Ezes
    Thanks....It worked perfect....I can continue now....
    0
     

    Author Comment

    by:Ezes
    oops..
    I'm now having this error and don´t understand why...
    I carry on "navigating" through this web and have to set 3 times the objDoc.
    Set objDoc = IE.document
        Set objDoc = objDoc.frames(1).document
        Set objDoc = objDoc.frames(1).document
        Set objDoc = objDoc.frames(1).document

    It ones worked, but now i have the following error:
    -2147352567 Exception....
    0
     

    Author Comment

    by:Ezes
    My mistake....i had commented some lines and didn´t notice it...The problem now is the following. I'm trying to download a file by "clicking" a link, but i don't want to be displayed the window for saving the file....
    0
     
    LVL 17

    Accepted Solution

    by:
    >>Question Title: VB WebBrowser Frames Login problem
    I believe your question is resolved.

    >>but i don't want to be displayed the window for saving the file
    You can handle it in the BeforeNavigate2() event. If it's the file is in the URL parameter, download it manually (through INET for example) and set Cancel to "True" so the browser does not navigate to it.

    Since it's an entirely different question, I'm not going to comment further on it. I hope you understand.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now