A
andland
I am trying to open an excel file online, but I think that it requires
Java programming to do so. I want to go to
http://www.powertochoose.org/_content/_compare/compare.aspx then put
in zip code 77028 and then download the excel file on the next page. I
have figured out how to put in the zip code and get to the next page,
but not how to download the excel file (there is a link on the bottom
right of the screen). Here is what I have:
Sub AutomateIE()
Dim ie As InternetExplorer
Dim MyStr As String
Set ie = New InternetExplorer
ie.Navigate "http://www.powertochoose.org/_content/_compare/
compare.aspx"
ie.Visible = True
'Loop unitl ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
ie.Document.getelementbyid("txtZipCode").Value = "77028"
ie.Document.getelementbyid("cmdSearchZip").Click
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()),
Second(Now()) + 2)
ie.Document.getelementbyid("lnkExportOffers").Click
Set ie = Nothing
End Sub
Java programming to do so. I want to go to
http://www.powertochoose.org/_content/_compare/compare.aspx then put
in zip code 77028 and then download the excel file on the next page. I
have figured out how to put in the zip code and get to the next page,
but not how to download the excel file (there is a link on the bottom
right of the screen). Here is what I have:
Sub AutomateIE()
Dim ie As InternetExplorer
Dim MyStr As String
Set ie = New InternetExplorer
ie.Navigate "http://www.powertochoose.org/_content/_compare/
compare.aspx"
ie.Visible = True
'Loop unitl ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
ie.Document.getelementbyid("txtZipCode").Value = "77028"
ie.Document.getelementbyid("cmdSearchZip").Click
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()),
Second(Now()) + 2)
ie.Document.getelementbyid("lnkExportOffers").Click
Set ie = Nothing
End Sub