Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Code Modification

Posted on 2016-08-27
6
Medium Priority
?
48 Views
Last Modified: 2016-08-28
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
Comment
Question by:Naresh Patel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 41773490
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
 
LVL 8

Author Comment

by:Naresh Patel
ID: 41773689
0
 
LVL 23

Accepted Solution

by:
Ejgil Hedegaard earned 2000 total points
ID: 41773892
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
Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

 
LVL 8

Author Comment

by:Naresh Patel
ID: 41773908
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
 
LVL 23

Expert Comment

by:Ejgil Hedegaard
ID: 41773973
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
 
LVL 8

Author Closing Comment

by:Naresh Patel
ID: 41774279
Thanks
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

618 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