Consulting

Results 1 to 9 of 9

Thread: Popup blocking my Progress

  1. #1
    VBAX Newbie
    Joined
    Jul 2005
    Location
    Memphis
    Posts
    5
    Location

    Popup blocking my Progress

    Good Morning. I have found that searching this website when I get stuck on a problem to be very helpful. However, I have a problem that I can't seem to find an answer to and decided I should post it.

    I am working in Excel 2003 and I am trying to pull various stock data from a Free website that is password protected. Below is the code I am using to input the login and password (thanks to some help on this website). My problem arises with a pop up window asking me if I want to continue to a nonsecure website. I have tried various strategies to click yes, but nothing seems to work. Does anyone have any ideas? Can this be done or should I just forget it?

    Sub ReutersPassword()
        Dim ie As Object
        Set ie = CreateObject("InternetExplorer.Application")
        Dim webbk As Workbook
        Dim webrng As Range
        Dim webFwdPE As Range
    With ie
    .navigate "https://secure.reuters.com/login/log...+Ratios+report."
    Do While .busy: DoEvents: Loop
    Do While .readystate <> 4: DoEvents: Loop
    With .Document.Forms("Form1")
    .EmailAddress.Value = "asdf@yahoo.com"
    .Password.Value = "asdf"
    SendKeys "{ENTER}", True
    End With
    .Visible = True
    End With
    End Sub
    My ultimate goal is to be able to download specific information on a list of stocks from this website for a project I am working on. I have used Yahoo!Finance, but this site has much more detailed information, which I need for this project.

    ANY help would be greatly appreciated. HAVE A GOOD DAY!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Step through the code, see where it gets to when the box pops up, and throw in another Sendkeys


    SendKeys "{ENTER}", True
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    From IE | Tools | Internet Options | Security | Custom Level .. then set those Miscellaneous options which you'd like. Most should be able to get set at Enable. The one you're looking for would be on Prompt.

  4. #4
    VBAX Newbie
    Joined
    Jul 2005
    Location
    Memphis
    Posts
    5
    Location
    Thanks for you both for your help. Unfortunately, neither of those suggestions seem to accomplish what I need.

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi and Welcome to VBAX!

    If you are interested in Table data on that site then Why are you not using:

    Data | Get External Data | New Web Query.

    If you have 2002 or higher the wizard is very easy to follow and you can mark the data you like and import it in your sheet.

    The benefit is speed and reliabillity as well as refreshing the data very quickly!

    Just try it out.

    HTH,
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  6. #6
    VBAX Newbie
    Joined
    Jul 2005
    Location
    Memphis
    Posts
    5
    Location
    Mr. MOS,

    Thank you for responding. I have tried that and the problem lies in that I share this file with others. When someone else opens it on their computer, it will not work. Now it is entirely possible I am entering the code incorrectly.

    What would the .savepassword field need to be? TRUE/FALSE?

  7. #7
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    Just call me Joost!

    This works for me to get in:

    Option Explicit
    
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Sub ReutersPassword()
        Dim ie As Object
        Set ie = CreateObject("InternetExplorer.Application")
        Dim webbk As Workbook
        Dim webrng As Range
        Dim webFwdPE As Range
    With ie
            .navigate "https://secure.reuters.com/login/log...+Ratios+report"
            Do While .busy: DoEvents: Loop
                Do While .readystate <> 4: DoEvents: Loop
    With .Document.Forms("Form1")
                        .EmailAddress.Value = "asdf@yahoo.com"
                        .Password.Value = "asdf"
                        .all("_ctl5").Click
                    End With
            .Visible = True
            Sleep 7000&
            SendKeys "{ENTER}", True
        End With
    End Sub
    Play with the "Sleep 7000&" part! (Depends on the speed of your connection)

    Not pretty but it works.
    HTH,
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  8. #8
    VBAX Newbie
    Joined
    Jul 2005
    Location
    Memphis
    Posts
    5
    Location


    Joost -- This WORKS GREAT!!!!

    I am still trying to learn VBA and had no idea about Sleep. Thank you! I owe you one!

    Have a great day!

  9. #9
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by bradedi


    Joost -- This WORKS GREAT!!!!

    I am still trying to learn VBA and had no idea about Sleep. Thank you! I owe you one!

    Have a great day!
    Hi,
    You're Welcome!

    FYI the Sleep Function is a API (Application Program Interface) Function. You can call them from VBA but they are not part of VBA.

    Don't forget to mark your thread solved!

    HTH,
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •