Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening Excel files with VBA

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/_conten...e/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").Clic k
Set ie = Nothing
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Opening Excel files with VBA

On Mar 24, 1:43*pm, " wrote:
I am trying to open an excel file online, but I think that it requires
Java programming to do so. I want to go tohttp://www.powertochoose.org/_content/_compare/compare.aspxthen 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").Clic k
* * Set ie = Nothing
End Sub

on the buttom of your code, change
ie.Document.getelementbyid("lnkExportOffers").Clic k
To
ie.Document.all("lnkExportOffers").Click
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening Excel files with VBA

On Mar 24, 2:55*pm, GTVT06 wrote:
On Mar 24, 1:43*pm, " wrote:



I am trying to open an excel file online, but I think that it requires
Java programming to do so. I want to go tohttp://www.powertochoose.org/_content/_compare/compare.aspxthenput
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").Clic k
* * Set ie = Nothing
End Sub


on the buttom of your code, change
ie.Document.getelementbyid("lnkExportOffers").Clic k
To
ie.Document.all("lnkExportOffers").Click- Hide quoted text -

- Show quoted text -


Thanks for the help.
When I modified the program, Internet Explorer gives a message saying
that it blocked the site from downloading files on my computer. When I
manually tell it to download the file anyway, it just refreshes the
page and nothing downloads.
Is there a way to disable protection/ error messages like this in the
code or for specific websites?
I am using IE7 by the way.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Opening Excel files with VBA

On Mar 25, 11:30*am, Andrew Landgraf wrote:
On Mar 24, 2:55*pm, GTVT06 wrote:





On Mar 24, 1:43*pm, " wrote:


I am trying to open an excel file online, but I think that it requires
Java programming to do so. I want to go tohttp://www.powertochoose.org/_content/_compare/compare.aspxthenput
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").Clic k
* * Set ie = Nothing
End Sub


on the buttom of your code, change
ie.Document.getelementbyid("lnkExportOffers").Clic k
To
ie.Document.all("lnkExportOffers").Click- Hide quoted text -


- Show quoted text -


Thanks for the help.
When I modified the program, Internet Explorer gives a message saying
that it blocked the site from downloading files on my computer. When I
manually tell it to download the file anyway, it just refreshes the
page and nothing downloads.
Is there a way to disable protection/ error messages like this in the
code or for specific websites?
I am using IE7 by the way.- Hide quoted text -

- Show quoted text -


If you set the website as a "Trusted Web Site" in your IE settings you
should be able to bypass this error.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening Excel files with VBA

On Mar 26, 10:23*am, GTVT06 wrote:
On Mar 25, 11:30*am, Andrew Landgraf wrote:





On Mar 24, 2:55*pm, GTVT06 wrote:


On Mar 24, 1:43*pm, " wrote:


I am trying to open an excel file online, but I think that it requires
Java programming to do so. I want to go tohttp://www.powertochoose.org/_content/_compare/compare.aspxthenput
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").Clic k
* * Set ie = Nothing
End Sub


on the buttom of your code, change
ie.Document.getelementbyid("lnkExportOffers").Clic k
To
ie.Document.all("lnkExportOffers").Click- Hide quoted text -


- Show quoted text -


Thanks for the help.
When I modified the program, Internet Explorer gives a message saying
that it blocked the site from downloading files on my computer. When I
manually tell it to download the file anyway, it just refreshes the
page and nothing downloads.
Is there a way to disable protection/ error messages like this in the
code or for specific websites?
I am using IE7 by the way.- Hide quoted text -


- Show quoted text -


If you set the website as a "Trusted Web Site" in your IE settings you
should be able to bypass this error.- Hide quoted text -

- Show quoted text -


I added the Trusted Web Site but that didn't make any difference, but
I read the IE help on how to disable the pop up blocker for certain
things and I changed those settings. Then I still got 2 messages. One
was asking me to open or save. I unchecked the box that said always
ask this question (it may have been better to figure out how to do
this in the code but it's taken me long enough). The second message
asked me if I am sure I want to open the file because it is .aspx for
some reason. I got rid of this by adding:

Application.DisplayAlerts = False

So it looks like I am good to go for now.
Thanks for your help


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening Excel files with VBA

On Mar 27, 5:56*pm, Andrew Landgraf wrote:
On Mar 26, 10:23*am, GTVT06 wrote:





On Mar 25, 11:30*am, Andrew Landgraf wrote:


On Mar 24, 2:55*pm, GTVT06 wrote:


On Mar 24, 1:43*pm, " wrote:


I am trying to open an excel file online, but I think that it requires
Java programming to do so. I want to go tohttp://www.powertochoose..org/_content/_compare/compare.aspxthenput
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").Clic k
* * Set ie = Nothing
End Sub


on the buttom of your code, change
ie.Document.getelementbyid("lnkExportOffers").Clic k
To
ie.Document.all("lnkExportOffers").Click- Hide quoted text -


- Show quoted text -


Thanks for the help.
When I modified the program, Internet Explorer gives a message saying
that it blocked the site from downloading files on my computer. When I
manually tell it to download the file anyway, it just refreshes the
page and nothing downloads.
Is there a way to disable protection/ error messages like this in the
code or for specific websites?
I am using IE7 by the way.- Hide quoted text -


- Show quoted text -


If you set the website as a "Trusted Web Site" in your IE settings you
should be able to bypass this error.- Hide quoted text -


- Show quoted text -


I added the Trusted Web Site but that didn't make any difference, but
I read the IE help on how to disable the pop up blocker for certain
things and I changed those settings. Then I still got 2 messages. One
was asking me to open or save. I unchecked the box that said always
ask this question (it may have been better to figure out how to do
this in the code but it's taken me long enough). The second message
asked me if I am sure I want to open the file because it is .aspx for
some reason. I got rid of this by adding:

Application.DisplayAlerts = False

So it looks like I am good to go for now.
Thanks for your help- Hide quoted text -

- Show quoted text -


Ok, there website has changed a little (plus I never really figured
out completely how to do what I was doing before). Now it creates an
XML file instead of an excel sheet. I can get it to create a dialog
box asking me what to do with the xml file (Save or Open). I would
like to be able to save the xml file to a specified location. Again,
here is what I have:

Sub AutomateIE()
Application.DisplayAlerts = False

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
Application.Wait TimeSerial(Hour(Now()), Minute(Now()),
Second(Now()) + 2)
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
ie.Document.all("lnkExportOffers").Click
End Sub


Any help would be appreciated.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel files not opening Trizia Excel Discussion (Misc queries) 3 May 18th 08 11:44 AM
show most recent files first when opening excel files Anne` Excel Discussion (Misc queries) 5 January 23rd 08 01:54 AM
Excel files not opening [email protected] Excel Discussion (Misc queries) 13 November 16th 07 03:58 PM
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 PoundMutt Excel Discussion (Misc queries) 1 June 20th 07 03:50 AM
Opening Excel files Bungalow Excel Discussion (Misc queries) 3 February 22nd 05 09:15 PM


All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"