PC Review


Reply
Thread Tools Rate Thread

Automate Excel download of csv file without proper URL?

 
 
briana.kobor@gmail.com
Guest
Posts: n/a
 
      27th Dec 2007
I am looking for a way to automate downloading natural gas market data
that is available here:

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.
 
Reply With Quote
 
 
 
 
The Dude
Guest
Posts: n/a
 
      28th Dec 2007
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
---------------------------------------------------


"(E-Mail Removed)" wrote:

> I am looking for a way to automate downloading natural gas market data
> that is available here:
>
> 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.
>

 
Reply With Quote
 
briana.kobor@gmail.com
Guest
Posts: n/a
 
      3rd Jan 2008
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
> ---------------------------------------------------
>
> "briana.ko...@gmail.com" wrote:
> > I am looking for a way to automate downloading natural gas market data
> > that is available here:

>
> >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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to automate excel file sending by outlook from within the file Adrian Microsoft Excel Misc 0 12th Sep 2008 01:43 PM
what is the proper file format for excel 2003 greg Microsoft Excel Programming 5 2nd Sep 2008 09:43 PM
Automate Excel export to a CSV file Chris B Microsoft Excel Programming 1 25th Jun 2008 07:46 PM
How to use ADOX on Excel? How to automate Excel invocation on existing xls file from vbs? Siegfried Heintze Microsoft Excel Programming 0 7th Jun 2008 08:03 PM
Excel add-in w/ Library.dll file, ? proper folder for the dll =?Utf-8?B?TW9sZE1hbg==?= Microsoft Excel Misc 0 26th Apr 2006 10:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:57 AM.