Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Opening an IE window from another IE window

Hello,

I am trying to write some code in order to download data off the
internet. It involves going to a website, running a query, exporting
the query to a .csv file, and downloading the file. I am experiencing a
problem when trying to export the query.

When doing it manually, after the query is run, you can select an
"Export" option from a drop down menu. Selecting that causes a new IE
window to open and it asks if you would like to export as a .csv or a
..pdf. You make your choice, and you click Submit.

There is a specific web address you can enter to bring up the prompt
that asks you if you want to export as a .csv or .pdf. The only problem
is, if you just have an IE window navigate to that address, it does not
link that site to a query. It just opens the web address as is. So I
want the code to behave just as doing it manually would, meaning, I
want a new IE window to open from the original IE window.

My code:

*****

Sub getOutages()

Dim IE As Object, url As String, url2 As String, url3 As String,
url4 As String, url5 As String
Dim IE2 As Object

Set IE = CreateObject("internetexplorer.application")

'''This is the url of the website.
url = "http://www.... com"
'''This is the url that shows the results of the query.
url2 = "http://www.... com"
'''This is the url that shows the prompt for exporting as .csv or
..pdf.
url3 = "http://www.... com"

Set IE2 = CreateObject("internetexplorer.application")

With IE
.Visible = True
.navigate url (opens the website)
.navigate url2 (runs the query)
IE2.visible = True
.navigate url3
''' Somehow I would like url to be navigated from IE but
for it to be opened in IE2.

End With
End Sub

*****

Any help on this would be greatly appreciated! Thanks!!!!

- Keith

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Opening an IE window from another IE window

wrote:
Hello,

I am trying to write some code in order to download data off the
internet. It involves going to a website, running a query, exporting
the query to a .csv file, and downloading the file. I am experiencing
a problem when trying to export the query.

When doing it manually, after the query is run, you can select an
"Export" option from a drop down menu. Selecting that causes a new IE
window to open and it asks if you would like to export as a .csv or a
.pdf. You make your choice, and you click Submit.

There is a specific web address you can enter to bring up the prompt
that asks you if you want to export as a .csv or .pdf. The only
problem is, if you just have an IE window navigate to that address,
it does not link that site to a query. It just opens the web address
as is. So I want the code to behave just as doing it manually would,
meaning, I want a new IE window to open from the original IE window.

My code:

*****

Sub getOutages()

Dim IE As Object, url As String, url2 As String, url3 As String,
url4 As String, url5 As String
Dim IE2 As Object

Set IE = CreateObject("internetexplorer.application")

'''This is the url of the website.
url = "http://www.... com"
'''This is the url that shows the results of the query.
url2 = "http://www.... com"
'''This is the url that shows the prompt for exporting as .csv or
.pdf.
url3 = "http://www.... com"

Set IE2 = CreateObject("internetexplorer.application")

With IE
.Visible = True
.navigate url (opens the website)
.navigate url2 (runs the query)
IE2.visible = True
.navigate url3
''' Somehow I would like url to be navigated from IE but
for it to be opened in IE2.

End With
End Sub

*****

Any help on this would be greatly appreciated! Thanks!!!!

- Keith


Why worry about the csv. Why not just create an Excel web query and get the
data from url2?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Opening an IE window from another IE window

wrote:
Hello,

I am trying to write some code in order to download data off the
internet. It involves going to a website, running a query, exporting
the query to a .csv file, and downloading the file. I am experiencing
a problem when trying to export the query.

When doing it manually, after the query is run, you can select an
"Export" option from a drop down menu. Selecting that causes a new IE
window to open and it asks if you would like to export as a .csv or a
.pdf. You make your choice, and you click Submit.

There is a specific web address you can enter to bring up the prompt
that asks you if you want to export as a .csv or .pdf. The only
problem is, if you just have an IE window navigate to that address,
it does not link that site to a query. It just opens the web address
as is. So I want the code to behave just as doing it manually would,
meaning, I want a new IE window to open from the original IE window.

My code:

*****

Sub getOutages()

Dim IE As Object, url As String, url2 As String, url3 As String,
url4 As String, url5 As String
Dim IE2 As Object

Set IE = CreateObject("internetexplorer.application")

'''This is the url of the website.
url = "http://www.... com"
'''This is the url that shows the results of the query.
url2 = "http://www.... com"
'''This is the url that shows the prompt for exporting as .csv or
.pdf.
url3 = "http://www.... com"

Set IE2 = CreateObject("internetexplorer.application")

With IE
.Visible = True
.navigate url (opens the website)
.navigate url2 (runs the query)
IE2.visible = True
.navigate url3
''' Somehow I would like url to be navigated from IE but
for it to be opened in IE2.

End With
End Sub

*****

Any help on this would be greatly appreciated! Thanks!!!!

- Keith


And why are you bothering to go to url1 in the first place?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Opening an IE window from another IE window

I haven't ever created an Excel web query, so I'm not really sure what
to do for that. I'm not overly concerned with doing it the most
efficient way. I just want it to work.

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
how to save a desired window size but hv window comeup fullsz by d smjm1982 Excel Discussion (Misc queries) 1 February 15th 08 11:10 AM
View cell contents as a pop-up window (similar to comments window) Oldersox Excel Worksheet Functions 1 February 6th 08 07:09 AM
Docking Project Explorer, Properties window and Code window in VBE jayray Setting up and Configuration of Excel 2 March 27th 07 04:42 PM
The window opens in a smaller window not full sized window. Rachael Excel Discussion (Misc queries) 0 November 7th 06 09:04 PM
In Excel - how to delete new window created from window on tool ba Doug Excel Worksheet Functions 1 April 20th 06 09:22 PM


All times are GMT +1. The time now is 06:42 AM.

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"