+ Reply to Thread
Results 1 to 3 of 3

VBA for Morningstar Search Button

  1. #1
    Registered User
    Join Date
    08-08-2019
    Location
    California, USA
    MS-Off Ver
    2016
    Posts
    2

    Question VBA for Morningstar Search Button

    Hi guys,

    I am trying to get use a macro to go to the webpage of a stock that gets entered into the search bar of morningstar. I found a useful youtube video that showed me the code that allows you to open up internet explorer and enter in the name of the stock into an input box, which will then enter it automatically into the search bar of the webpage, but that is as far as I have gotten. I got it to work up to that point, but am stuck on the part to get it to click search to load up the page.


    Can someone help me?

  2. #2
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    309

    Re: VBA for Morningstar Search Button

    Need to show us your code so far.

  3. #3
    Registered User
    Join Date
    08-08-2019
    Location
    California, USA
    MS-Off Ver
    2016
    Posts
    2

    Re: VBA for Morningstar Search Button

    Sub clickformbutton()
    Dim ie As Object
    Dim form As Variant, button As Variant


    Set ie = CreateObject("internetexplorer.application")

    mystock = InputBox("enter stock name, eg. pepsico inc, coca-cola co")

    With ie

    .Visible = True
    .navigate ("website url here")

    While ie.readystate <> 4
    DoEvents
    Wend

    ie.document.getelementsbyclassname("mdc-site-search__form").Item.innertext = mystock

    Set frm = ie.document.forms("f")
    Set srch = frm.document.all("q")
    srch.Value = Rng
    frm.submit

    End With

    Set ie = Nothing

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Search Bar that Executes Search Based on Radio Button and Key Words
    By pomo2016 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2016, 09:26 AM
  2. Replies: 1
    Last Post: 10-02-2014, 05:02 PM
  3. Excel VBA and morningstar problem with table
    By pob944 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2014, 03:37 PM
  4. How can I query Morningstar if I have a user ID and Password
    By jpattavina in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2013, 09:17 AM
  5. [SOLVED] Macro/s to create Search Bar to filter to search terms entered activated by Command Button
    By JasonRay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2013, 03:44 PM
  6. Login to morningstar
    By max3732 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2011, 05:34 PM
  7. Formatting financial data from Morningstar
    By Gallardo in forum Excel General
    Replies: 3
    Last Post: 12-13-2005, 09:50 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1