PC Review


Reply
Thread Tools Rate Thread

Scheduled tasks - macros

 
 
Tom Gribbin
Guest
Posts: n/a
 
      28th Nov 2003
If anyone could help me out here I would be eternally grateful.

I have scheduled a data I am using to retrive some information that I
require every day at a set time into a single excel spreadsheet. So
far so good – this works fine. However, every time the new updated
data is imported into the spreadsheet, it overwrites the exisating
data in the spreadsheet losing me the previous days data.

Is it possible to schedule a macro within windows to copy the file
which the data imports into and then paste it as a file with a new
name e.g. ‘data (dd-mm-yyyy)' so that I build up a folder containing
new files of each days data whilst the original file can just be
overwritten each day and only contain that days data.

I am using Windows 2000 Professional and presume I can use scheduled
tasks to do this but do not have a clue how to go about this. Any
advise would be really appreciated.
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      28th Nov 2003
Where does the data come from that you wish to import?
Is it an existing file? Does the file have a fixed name?
Is it the previous day's file? An example might be helpful
in explaining what you're trying to achieve.


"Tom Gribbin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If anyone could help me out here I would be eternally grateful.
>
> I have scheduled a data I am using to retrive some information that I
> require every day at a set time into a single excel spreadsheet. So
> far so good - this works fine. However, every time the new updated
> data is imported into the spreadsheet, it overwrites the exisating
> data in the spreadsheet losing me the previous days data.
>
> Is it possible to schedule a macro within windows to copy the file
> which the data imports into and then paste it as a file with a new
> name e.g. 'data (dd-mm-yyyy)' so that I build up a folder containing
> new files of each days data whilst the original file can just be
> overwritten each day and only contain that days data.
>
> I am using Windows 2000 Professional and presume I can use scheduled
> tasks to do this but do not have a clue how to go about this. Any
> advise would be really appreciated.



 
Reply With Quote
 
Phil Robyn
Guest
Posts: n/a
 
      28th Nov 2003
Tom Gribbin wrote:

> If anyone could help me out here I would be eternally grateful.
>
> I have scheduled a data I am using to retrive some information that I
> require every day at a set time into a single excel spreadsheet. So
> far so good – this works fine. However, every time the new updated
> data is imported into the spreadsheet, it overwrites the exisating
> data in the spreadsheet losing me the previous days data.
>
> Is it possible to schedule a macro within windows to copy the file
> which the data imports into and then paste it as a file with a new
> name e.g. ‘data (dd-mm-yyyy)' so that I build up a folder containing
> new files of each days data whilst the original file can just be
> overwritten each day and only contain that days data.
>
> I am using Windows 2000 Professional and presume I can use scheduled
> tasks to do this but do not have a clue how to go about this. Any
> advise would be really appreciated.


Assuming that on your system the built-in %date% variable has the
format

<Win2000> c:\cmd>echo %date%
Fri 11/28/2003

you could do

copy datafile.dat "data %date:~10,4%-%date:~4,2%-%date:~7,2%.dat"

In the long run, you will be much happier if you use a date format
like yyyy-mm-dd rather than dd-mm-yyyy in your file names. :-) And
you should avoid the use of parentheses in your file names!

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Scheduled Tasks to run Macros problem Andy Microsoft Access 2 12th Jan 2010 06:01 PM
Add Scheduled Task wizard in Scheduled Tasks won't run =?Utf-8?B?U01GYWlzb24=?= Microsoft Windows 2000 4 12th May 2005 01:26 AM
starting macros via scheduled tasks mnichols Microsoft Excel Programming 1 24th May 2004 10:37 AM
Scheduled Tasks scheduled time automatically changing Chris Windows XP Performance 0 24th Dec 2003 09:24 PM
Scheduled tasks - macros Tom Gribbin Windows XP General 0 28th Nov 2003 12:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:24 AM.