Solved

Code Modification

Posted on 2014-11-08
6
118 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 40

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 Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 40

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My experience with Windows 10 over a one year period and suggestions for smooth operation
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

821 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