Log in

View Full Version : Login to morningstar



max3732
11-25-2011, 02:27 PM
I'm trying to login to my morningstar account and download some of my performance history.

I'm using early binding so I have access to intellisense. What I've written goes to the page, but gives an "Automation error (Error 440)" when I try to get it to put my login info.

I have gone to "tools -> references -> shdocvw.dll" as well as microsoft internet controls

Sub Morningstar()

Dim ie As New SHDocVw.InternetExplorer
Set ie = New SHDocVw.InternetExplorer
ie.Visible = True
ie.Navigate ("https://members.morningstar.com/memberservice/login.aspx")
While ie.Busy
DoEvents
Wend


ie.Document.all("email_textbox").Value = "username@service.com"


End Sub

max3732
11-28-2011, 04:38 PM
I was able to get the part to work by adding a line to wait.

Now I'm running into a different problem. I'm able to login and click on the button to download my investment info as an excel file, but then the internet explorer save dialogue box opens up and I don't have a clue how to tell it to save.

I tried looking at the source, but don't see anything referring to the "save, open, or cancel" dialogue options.


Sub Morningstar()

Dim ie As New SHDocVw.InternetExplorer
Set ie = New SHDocVw.InternetExplorer
ie.Visible = True
ie.Navigate ("morningstarwebsite")
While ie.Busy
Application.Wait (Now + TimeValue("00:00:01"))
Wend

ie.Document.getElementById("LoginEmail").Value = "username@service.com"
ie.Document.getElementById("LoginPwd").Value = "password"
'Application.Wait (Now + TimeValue("00:00:01"))
'ie.Document.getElementById("fakeremember").Click
ie.Document.getElementById("LogInBtn").Click
While ie.Busy
Application.Wait (Now + TimeValue("00:00:01"))
Wend
ie.Document.getElementById("ctl00_ctl00_ctl00_BodyRegion_ViewRegion_export").Click


End Sub