Thread: Timed Macro
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Timed Macro

One easy method would be to stick the workbook in your XLSTART folder and set up
Task Scheduler to just start Excel.

Or point task scheduler to a short cut like

"C:\Program Files\Microsoft Office\Exceldata\12months.xls"

You will have to enter a Windows login password if you use one.

See Help and Support "schedule tasks" for more info on how to set up a scheduled
task.


Gord

On 19 Mar 2007 10:31:48 -0700, "Sean" wrote:

On Mar 19, 4:53 pm, Gord Dibben <gorddibbATshawDOTca wrote:
Sean

You code would be placed into a Workbook_Open Sub which will run when Task
Scheduler starts Excel with your workbook.

Gord Dibben MS Excel MVP

On 19 Mar 2007 05:18:44 -0700, "Sean" wrote:



On Mar 19, 8:38 am, Damien McBain wrote:
Sean wrote:
I have some code that I run every Saturday and Sunday at 2:00pm in a
Workbook.


Is it possible to somehow automatically run this macro without the
workbook being actually open and without me actually been present?


I would have the exact Date and Time that I want it to run at in a
cell, say A1. Reason I have this is that I use a new copy of the
workbook each week, so I only want the current file to run, not all
the historic files too.


You could use the Windows Scheduler to open the workbook. You'll have to
turn off macro security on that computer.


How would I use the schedule task to run code within my Excel file?- Hide quoted text -


- Show quoted text -


Thanks Gordon

Is it as simple as that? I thought with schedule task you had to
create a Batch file?

So I place my code in Workbook_Open sub, select my file on a New
Schedule Task, select time / date etc and that its?

I assume Excel application doesn't have do be open (or does it?) and
all I need to ensure is my PC's on?

Thanks