Here is a code fragment that should get you started
Here is the WaitForIEReady![]()
Public Sub LoginDashboard() Dim iDD As Long ' Loop variable for items in a dropdown box Dim MyTime As Long MyTime = Range("MyTime") Range("C5") = Now() Range("A14:D100").ClearContents ' Open the browser Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True 'Navigate to the URL ie.Navigate Range("DashboardURL") Do Until ie.readystate = 4: DoEvents: Loop ' create reference to document Set doc = ie.document ' create references to the form, inputs and button Set ieFrm = doc.forms("login") Set ieUser = doc.getelementbyID("USER") Set iePwd = doc.getelementbyID("PASSWORD") Set ieButton = doc.getelementbyID("idlogon") ' Enter the login credentials ieUser.Value = Range("MyLogin") iePwd.Value = Range("MyPassword") ' Log in ieButton.Click WaitForIEReady ' Navigate to the page. ...
![]()
Public Sub WaitForIEReady() Do While doc.readystate <> "complete" DoEvents Loop End Sub
Bookmarks