MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Automatic macro task once every week.


Posted by Sarah on August 11, 2000 4:42 AM

Hi there Guys and Girls.

I thought of an idea to help my programme - Except I don't know how to do it or know if it can be done.

The idea is that on every sunday of every week the macro performs an automatic task.

I want the automatic task to delete a column (A) then save.

If the above can't be done, then when the user 1st opens the workbook of that week it will perform the task then and there. It must only do this once per week.

Is this clear and is this possible.

Sarah.


Posted by Sarah on August 14, 0100 2:37 AM

Thanks Mike,

I think I'll take option 1 please as Our systems are on Windows '95.

Any help in implementing the code will help tremendously.

Sarah.

Posted by Michael Liu on August 14, 0100 7:55 AM

Send me an E-mail and I can send you a sample file.

Posted by Michael Liu on August 11, 0100 3:36 PM

Which operating system are you using?

You could approach this issue in two ways.
One is to have it run the deletion macro upon
the workbook being opened, with the last run date
put in a cell on one of the sheets, so you can
make sure it only executes once a week.

The other requires Win98 or NT. A relatively
clean way would be to create a new workbook (#1), and
write code that opens the other file (#2), deletes the
column, saves it, and closes that file (#2). This procedure
would have to be called Auto_Open() so that it will
automatically run when this file is opened.
Then you'd set up a new "scheduled task" (w98 or NT) to open
file #1 at a set time on Sunday. When it opens, it runs
the Auto_Open() macro which opens #2, deletes stuff,
saves, closes, and exits out of Excel.

I have a similar setup right now with some files
that generate reports on weekdays before I get to
work.

Let me know if you need any additional help in
implementing this.

Mike