VB WebBrowser Frames Login problem

Posted on 2004-10-29
Last Modified: 2013-12-26
I'm Trying to automate a Login Proccess with WebBrowser Control. The web is The problem is that when I go to: IE.navigate "" there is no "txtUsuario" field to fill. But if I go to IE.navigate "" 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 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?
Question by:Ezes
    LVL 14

    Expert Comment

    by:Shiju Sasidharan
    First u navigate to
    Whet this document gets completed try to navigage
    and after this Document is Loaded completely , "click" on the Log In Link


    Author Comment

    I tried that by doing the following:
    Ie.navigate ""
    on the Document_Complete: I use another control IE2 by:
    IE2.navigate "" 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)

    But still doesn´t work...
    LVL 17

    Expert Comment

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

    Private Sub Command1_Click()
        Dim objDoc As Object
        Call WebBrowser1.Navigate("")
        Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
        Set objDoc = WebBrowser1.Document
        Set objDoc = objDoc.frames(1).Document
        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

    Author Comment

    Thanks....It worked perfect....I can continue now....

    Author Comment

    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....

    Author Comment

    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....
    LVL 17

    Accepted Solution

    >>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.

    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