Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 49
  • Last Modified:

Code Modification

I had this question after viewing RT - Data.

Hi Experts,

i need little modification in existing code.please help me out.
in attached WB Sheet main - Button Start Process - it will download zip files from server - unzip - post entries to respected file.it download data for duration between date - Cell G3 & Cell H3. after process completed in cell G3 date is change to last downloaded file date plus 1.

Need  modification
A) Change in download path i.e. fix download path in code it self instead of selecting in main sheet....path is D:\RTTrading\Data\
B) current process download data and past last date+1 in cell G3...so on next day if i click Start process button - it will delete all file and download new files and post to respective sheet .....but problem arise there ....i see only one entry in respected sheets ...i required macro dont delete old entries in respective sheet and post only new entries and limit entries to 30 row data (header is so in real term last data line is row 31).

See attached

Thanks
Sample.xlsm
0
Naresh Patel
Asked:
Naresh Patel
  • 3
  • 2
1 Solution
 
MacroShadowCommented:
A) Change in download path i.e. fix download path in code it self instead of selecting in main sheet....path is D:\RTTrading\Data\

Open in new window

In sheet Main replace this:
gstDestinationFolder = GetNewFolder(gstDestinationFolder, "Destination Folder")

Open in new window

with this:
gstDestinationFolder = GetNewFolder("D:\RTTrading\Data\", "Destination Folder")

Open in new window


.....but problem arise there ....i see only one entry in respected sheets ...i required macro dont delete old entries in respective sheet and post only new entries and limit entries to 30 row data (header is so in real term last data line is row 31).
I don't understand.
0
 
Naresh PatelTraderAuthor Commented:
0
 
Ejgil HedegaardCommented:
The original workbook had the start date = today - 45.
That creates the required zip and csv files for all 30 entries.
Then the csv update use the most recent 30 files, also if you miss a daily update.

If the macro does not change the start date, it works.
See sample file where start date change in macro removed.
Fixed folder D:\RTTrading\Data\
Screen updating turned off.
Added a Status form to show the progress.

This was much easier to change than write a new process for the csv update, and I think it is better to do a complete update.
It only runs about a minute.
Sample.xlsm
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
Naresh PatelTraderAuthor Commented:
ok no worries ...i thought if we required daily one file to update all sheets or say if i dint done process for 2 days then ...previous method will start download from that date  were we left ,,,so only 2 files download and update sheets accordingly.

just waiting  for  your view point ....after that i will close this question.

Thanks
0
 
Ejgil HedegaardCommented:
It is more complicated to check and adjust sheets to a random number of updates, than just update all.
That, and because the update time is not very long, is why I kept the original solution to update all.
0
 
Naresh PatelTraderAuthor Commented:
Thanks
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now