Solved

Code Modification

Posted on 2014-11-08
6
109 Views
Last Modified: 2014-11-10
Hi Experts,

I just need to change some in my existing code. this code download zip files from one site from start date to end date mention on excel cells. but it only for current year only if I have to download for past years ...it cant I have to change year in code
With oFso
        If Not .FolderExists(strSavePath) Then
            MakeMultiStepDirectory strSavePath
        End If
    End With

  iYear = 2014

    datLastDate = DateValue(strEndDate)      'DateSerial(iYear, 4, 9)
    datWorkDate = DateValue(strStartDate)    'DateSerial(iYear, 1, 1)

Open in new window

above is in module "mldownload"

need to change in code that download what ever start date and end date enter in cells i.e. any year and many year

see attached

Thanks
NSE-Eq.xlsm
0
Comment
Question by:itjockey
  • 2
  • 2
  • 2
6 Comments
 
LVL 39

Expert Comment

by:als315
ID: 40430950
Try to add one line after
Do
        strMonth = UCase(Format(datWorkDate, "MMM"))  ' upper case name of the month, like JAN

Open in new window


       
 iYear = Year(datWorkDate) 'Current Year

Open in new window

0
 
LVL 29

Expert Comment

by:gowflow
ID: 40431291
Here it is

Please replace this line
iYear = 2014

By these
Do
    On Error Resume Next
    iYear = InputBox("Please Enter Year to Process", "Year Input", Year(Now))
Loop Until Err = 0 And iYear >= 1900

Open in new window


Workbook attached.
Gowflow
NSE-Eq-V01.xlsm
0
 
LVL 8

Author Comment

by:itjockey
ID: 40432110
Mr.als315,

I tried but not working and I want loop to all dates between start date and end date.

Sir.Gowflow,

Attached WB working but it ask for year in message box ...need to download all files between start date (cell A1) to end date (cell B1) in one click (Button Download) .....current it ask for year. needed - say  start date is 1 jan 2013 & end date 20 apr 2014 then it will download all files between this dates irrespective of year i.e. no message box.

Thanks

Thanks
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 39

Accepted Solution

by:
als315 earned 250 total points
ID: 40432171
I've tested and it is working
NSE-Eq.xlsm
0
 
LVL 29

Assisted Solution

by:gowflow
gowflow earned 250 total points
ID: 40432175
Well then this should do it.
gowflow
NSE-Eq-V01.xlsm
0
 
LVL 8

Author Closing Comment

by:itjockey
ID: 40433453
Awesome
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now