I am trying to download fundamental financial data on several stocks (automatically) using a macro. Specifically, I would like to download one or more tables of data from Morningstar, such as the Key Ratios data (for Microsoft [MSFT] for example) at: financials.morningstar.com/ratios/r.html?t=MSFT®ion=USA&culture=en_US.
I thought I could use a QueryTable (such as when manually pulling data using -Data-, -From Web-), but when I try it manually I cannot access the data table (there is no yellow arrow next to it). However, there is an Export button on the webpage that apparently runs a Javascript routine [javascript:exportKeyStat2CSV()] to download a CSV file.
My question: Is there any way to program a VBA macro within Excel to access this webpage, execute the javascript routine, capture the resulting CSV data, and paste it into my existing worksheet (at a particular location)?
I am not a VBA expert, and I have no knowledge of Javascript at all, so please respond in simple terms and include sample code if possible. Thanks!
Bookmarks