ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automate Excel download of csv file without proper URL? (https://www.excelbanter.com/excel-programming/403300-automate-excel-download-csv-file-without-proper-url.html)

[email protected]

Automate Excel download of csv file without proper URL?
 
I am looking for a way to automate downloading natural gas market data
that is available he

https://www.services.nymex.com/otcse.../OTCSettle.jsp

The Usage agreement must be agreed to and then the link "Download all
available OTC settlement data" must be clicked prompting a CSV
download. I then need to copy this all into an excel sheet and can
take it from there.

Note: the link that prompts the download doesn't have a URL but is
"javascript:__doPostBack('ctl00$btnExport','') "

Is there a way to do this with web query?

Help is much appreciated. Thanks.

The Dude

Automate Excel download of csv file without proper URL?
 
Hello,
The following is unfortunately incomplete as I can't seem to find the
appropriate command to click the submit image, or submit the form/page. Hope
someone will help on that.

---------------------------------------------------
Sub download_csv()
Dim IE As New InternetExplorer, web_item, a, x

IE.Visible = True
IE.Navigate "https://www.services.nymex.com/otcsettlement/OTCSettle.jsp"
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

'Agrees with the Disclaimer form
If IE.LocationURL Like "*disclaimer*" Then
'Selects 'I agree'
IE.Document.Links(4).Click

'submits the form
!!!!!! PROBLEM HERE !!!!!!

End If

Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

'clicks on "Download all available..."
IE.Document.all.Item("ctl00_btnExport").Click

End Sub
---------------------------------------------------


" wrote:

I am looking for a way to automate downloading natural gas market data
that is available he

https://www.services.nymex.com/otcse.../OTCSettle.jsp

The Usage agreement must be agreed to and then the link "Download all
available OTC settlement data" must be clicked prompting a CSV
download. I then need to copy this all into an excel sheet and can
take it from there.

Note: the link that prompts the download doesn't have a URL but is
"javascript:__doPostBack('ctl00$btnExport','') "

Is there a way to do this with web query?

Help is much appreciated. Thanks.


[email protected]

Automate Excel download of csv file without proper URL?
 
Thanks so much for your help, I'm on the right track now!

On Dec 28 2007, 7:06 am, The Dude <f_com2°AT°yahoo°DOT°fr wrote:
Hello,
The following is unfortunately incomplete as I can't seem to find the
appropriate command to click the submit image, or submit the form/page. Hope
someone will help on that.

---------------------------------------------------
Sub download_csv()
Dim IE As New InternetExplorer, web_item, a, x

IE.Visible = True
IE.Navigate "https://www.services.nymex.com/otcsettlement/OTCSettle.jsp"
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

'Agrees with the Disclaimer form
If IE.LocationURL Like "*disclaimer*" Then
'Selects 'I agree'
IE.Document.Links(4).Click

'submits the form
!!!!!! PROBLEM HERE !!!!!!

End If

Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

'clicks on "Download all available..."
IE.Document.all.Item("ctl00_btnExport").Click

End Sub
---------------------------------------------------

" wrote:
I am looking for a way to automate downloading natural gas market data
that is available he


https://www.services.nymex.com/otcse.../OTCSettle.jsp


The Usage agreement must be agreed to and then the link "Download all
available OTC settlement data" must be clicked prompting a CSV
download. I then need to copy this all into an excel sheet and can
take it from there.


Note: the link that prompts the download doesn't have a URL but is
"javascript:__doPostBack('ctl00$btnExport','') "


Is there a way to do this with web query?


Help is much appreciated. Thanks.




All times are GMT +1. The time now is 09:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com