Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Code for file download

Hi,

Need some help automating a daily task of mine - downloading a zip file from a stock exchange site and saving it to disk.

Here are the steps involved:

Browse to http://www.bseindia.com/mktlive/bhavcopy.asp
Click on the link : "Download file in csv format (Zipped)" Alternatively, the file can be directly downloaded in which case the url would be http://www.bseindia.com/bhavcopy/eq<ddmmyy_csv.zip Of course ddmmyy would be replaced by date chosen by me.
Save zip to folder C:\abcd

Would be grateful for suggestions.

Cheers...
Vivek
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Code for file download

Sub test()

MyDate = Format(Date, "DDMMYY")
ZipFile = "eq" & MyDate & "_csv.zip"

Set fs = CreateObject("Scripting.FileSystemObject") '
fs.CopyFile "//www.bseindia.com/bhavcopy/" & ZipFile, "c:\abcd\"

End Sub

"Vivek" wrote:

Hi,

Need some help automating a daily task of mine - downloading a zip file from a stock exchange site and saving it to disk.

Here are the steps involved:

Browse to http://www.bseindia.com/mktlive/bhavcopy.asp
Click on the link : "Download file in csv format (Zipped)" Alternatively, the file can be directly downloaded in which case the url would be http://www.bseindia.com/bhavcopy/eq<ddmmyy_csv.zip Of course ddmmyy would be replaced by date chosen by me.
Save zip to folder C:\abcd

Would be grateful for suggestions.

Cheers...
Vivek

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Code for file download

Hi Joel,

Thanks for the code, works well for me :)

Vivek

"Joel" wrote in message ...
Sub test()

MyDate = Format(Date, "DDMMYY")
ZipFile = "eq" & MyDate & "_csv.zip"

Set fs = CreateObject("Scripting.FileSystemObject") '
fs.CopyFile "//www.bseindia.com/bhavcopy/" & ZipFile, "c:\abcd\"

End Sub

"Vivek" wrote:

Hi,

Need some help automating a daily task of mine - downloading a zip file from a stock exchange site and saving it to disk.

Here are the steps involved:

Browse to http://www.bseindia.com/mktlive/bhavcopy.asp
Click on the link : "Download file in csv format (Zipped)" Alternatively, the file can be directly downloaded in which case the url would be http://www.bseindia.com/bhavcopy/eq<ddmmyy_csv.zip Of course ddmmyy would be replaced by date chosen by me.
Save zip to folder C:\abcd

Would be grateful for suggestions.

Cheers...
Vivek

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
Code for file download Vivek[_2_] Excel Programming 0 February 12th 08 04:47 PM
Download zip file & extract/open excel file Mika Excel Programming 6 May 27th 07 10:02 PM
How to write a micro to download file at a URL save the file at the local PC www.microsoft.com Excel Programming 2 March 9th 06 02:21 AM
how do i download again i have key code remo85414 Excel Discussion (Misc queries) 1 December 19th 05 04:43 AM
Code to do a Web-download c mateland Excel Programming 1 October 31st 05 11:26 AM


All times are GMT +1. The time now is 10:30 AM.

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

About Us

"It's about Microsoft Excel"