• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to Download csv file from a dynamic date based url to a specified file location

Hi,

I have a requirement to download a lot of historical data files from the archieve of an website. The url goes something like this:
http://nseindia.com/content/nsccl/fa...i_21022014.csv

This downloads file for 21022014 ie. 21-Feb-2014. I need to be able to have a facility to have a selection criteria on my user form (in excel) where I specify a date range and the macro automatically downloads all the valid excel files available within that date range (files for Saturday, Sunday and some holiday dates will not be available in the website archive database) one after the other (like at single clcik of button) into a specific location (predefined viz.. c:/Users/EOD files/) on my laptop. Best would be if I am able to select the save location run time by using a 'Browse' like feature where I go and choose my local laptop folder...same type when we try uploading a file from our laptop to the web..

Request an urgent help and response please.

Regards
Shankhajit
 
Hi !​
I have a requirement to download a lot of historical data files from the archieve of an website.
Many ways to achieve it in Excel and even without via VBScript for example …

If you're not comfortable with Windows API
(see for example on MSDN function URLDownloadToFile),
don't forget Excel cans directly open a net csv file !

To browse the save location just read the inner VBA help for
Application.FileDialog(msoFileDialogFolderPicker) …​
 
Last edited:
Back
Top